diff --git a/blockchain/src/main/java/com/tangem/blockchain/blockchains/bitcoin/BitcoinTransactionHistoryProvider.kt b/blockchain/src/main/java/com/tangem/blockchain/blockchains/bitcoin/BitcoinTransactionHistoryProvider.kt index d6eef89d5..1c14ed03f 100644 --- a/blockchain/src/main/java/com/tangem/blockchain/blockchains/bitcoin/BitcoinTransactionHistoryProvider.kt +++ b/blockchain/src/main/java/com/tangem/blockchain/blockchains/bitcoin/BitcoinTransactionHistoryProvider.kt @@ -150,11 +150,13 @@ internal class BitcoinTransactionHistoryProvider( outputs + fee } else { val outputs = tx.vout - .find { it.addresses?.contains(walletAddress) == true} - ?.value.toBigDecimalOrDefault() + .filter { it.addresses?.contains(walletAddress) == true } + .map { it.value.toBigDecimalOrDefault() } + .sumOf { it } val inputs = tx.vin - .find { it.addresses?.contains(walletAddress) == true } - ?.value.toBigDecimalOrDefault() + .filter { it.addresses?.contains(walletAddress) == true } + .map { it.value.toBigDecimalOrDefault() } + .sumOf { it } outputs - inputs }