diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index 84fb7f473..af495fba7 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -2601,13 +2601,12 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB { final n = output["n"]; if (n != null && n == utxosToUse[i].vout) { String address = output["scriptPubKey"]["addresses"][0] as String; - if (bitbox.Address.detectFormat(address) == + if (bitbox.Address.detectFormat(address) != bitbox.Address.formatCashAddr) { - if (validateCashAddr(address)) { - address = bitbox.Address.toLegacyAddress(address); - } else { - throw Exception( - "Unsupported address found during fetchBuildTxData(): $address"); + try { + address = bitbox.Address.toCashAddress(address); + } catch (_) { + rethrow; } } if (!addressTxid.containsKey(address)) {