From 87b87ded0d46e594b6b5faaede2b7870dc905888 Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 25 Aug 2023 14:38:47 +0300 Subject: [PATCH] fix address book parsing --- cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart b/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart index 8f73fb328..35280aa6a 100644 --- a/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart +++ b/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart @@ -120,7 +120,9 @@ abstract class BitcoinCashWalletBase extends ElectrumWallet with Store { // Calculate the amount to send and change final sendAmount = transactionCredentials.outputs[0].formattedCryptoAmount!; - final outputAddress = transactionCredentials.outputs[0].address; + final outputAddress = transactionCredentials.outputs[0].isParsedAddress + ? transactionCredentials.outputs[0].extractedAddress + : transactionCredentials.outputs[0].address; final fee = bitbox.BitcoinCash.getByteCount(utxosToUse.length, 2); final changeAmount = totalBalance - sendAmount - fee;