From e115ff1b419d8315f0fca6ed5961c95ed3b96d11 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 12 Jan 2023 09:52:41 -0600 Subject: [PATCH] only use the PaymentData 'data' once and do not generate p2sh data using p2wpkh unless required --- lib/services/coins/bitcoincash/bitcoincash_wallet.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index 079bdce7f..33c3ca317 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -1430,9 +1430,6 @@ class BitcoinCashWallet extends CoinServiceAPI { ), ); final data = PaymentData(pubkey: node.publicKey); - final p2shData = - PaymentData(redeem: P2WPKH(data: data, network: _network).data); - String address; isar_models.AddressType addrType; @@ -1442,7 +1439,12 @@ class BitcoinCashWallet extends CoinServiceAPI { addrType = isar_models.AddressType.p2pkh; break; case DerivePathType.bip49: - address = P2SH(data: p2shData, network: _network).data.address!; + address = P2SH( + data: PaymentData( + redeem: P2WPKH(data: data, network: _network).data), + network: _network) + .data + .address!; addrType = isar_models.AddressType.p2sh; break; // default: