diff --git a/server/app/com/xsn/explorer/models/LightWalletTransaction.scala b/server/app/com/xsn/explorer/models/LightWalletTransaction.scala index daa5c44..3b281c5 100644 --- a/server/app/com/xsn/explorer/models/LightWalletTransaction.scala +++ b/server/app/com/xsn/explorer/models/LightWalletTransaction.scala @@ -12,7 +12,7 @@ case class LightWalletTransaction( object LightWalletTransaction { - case class Input(txid: TransactionId, index: Int) + case class Input(txid: TransactionId, index: Int, value: BigDecimal) case class Output(index: Int, value: BigDecimal) implicit val inputWrites: Writes[Input] = Json.writes[Input] diff --git a/server/app/com/xsn/explorer/services/TransactionService.scala b/server/app/com/xsn/explorer/services/TransactionService.scala index 7e9aba1..3bbb487 100644 --- a/server/app/com/xsn/explorer/services/TransactionService.scala +++ b/server/app/com/xsn/explorer/services/TransactionService.scala @@ -157,8 +157,10 @@ class TransactionService @Inject() ( vin <- getTransactionVIN(plain.vin).toFutureOr } yield { val inputs = vin - .filter(_.address contains address) - .map { _.into[LightWalletTransaction.Input].withFieldRenamed(_.voutIndex, _.index).transform } + .collect { + case TransactionVIN(txid, index, Some(value), Some(a)) if a == address => + LightWalletTransaction.Input(txid, index, value) + } val outputs = plain .vout