mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-12 09:32:33 +00:00
fix: change addr
This commit is contained in:
parent
046d30ba27
commit
a2bbd6a471
1 changed files with 5 additions and 1 deletions
|
@ -181,7 +181,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
|||
|
||||
final address = changeAddresses.firstWhere(
|
||||
// TODO: feature to choose change type
|
||||
(addressRecord) => _isUnusedReceiveAddressByType(addressRecord, SegwitAddresType.p2wpkh),
|
||||
(addressRecord) => _isUnusedChangeAddressByType(addressRecord, SegwitAddresType.p2wpkh),
|
||||
);
|
||||
return address;
|
||||
}
|
||||
|
@ -568,6 +568,10 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
|||
bool _isAddressByType(BitcoinAddressRecord addr, BitcoinAddressType type) =>
|
||||
addr.addressType == type;
|
||||
|
||||
bool _isUnusedChangeAddressByType(BitcoinAddressRecord addr, BitcoinAddressType type) {
|
||||
return addr.isChange && !addr.isUsed && addr.addressType == type;
|
||||
}
|
||||
|
||||
bool _isUnusedReceiveAddressByType(BitcoinAddressRecord addr, BitcoinAddressType type) {
|
||||
return !addr.isChange && !addr.isUsed && addr.addressType == type;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue