mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-19 09:15:11 +00:00
[skip ci] addressbook updates
This commit is contained in:
parent
bdc55064c9
commit
14cb65b8c9
1 changed files with 17 additions and 5 deletions
|
@ -324,7 +324,9 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
Future<String> getAddressAsync(
|
Future<String> getAddressAsync(
|
||||||
{required int index, required bitcoin.HDWallet hd, BitcoinAddressType? addressType}) async =>
|
{required int index,
|
||||||
|
required bitcoin.HDWallet hd,
|
||||||
|
BitcoinAddressType? addressType}) async =>
|
||||||
getAddress(index: index, hd: hd, addressType: addressType);
|
getAddress(index: index, hd: hd, addressType: addressType);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -381,6 +383,14 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
||||||
addressesMap[address] = 'Active - P2WSH';
|
addressesMap[address] = 'Active - P2WSH';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final lastMweb = _addresses.firstWhere(
|
||||||
|
(addressRecord) => _isUnusedReceiveAddressByType(addressRecord, SegwitAddresType.mweb));
|
||||||
|
if (lastMweb.address != address) {
|
||||||
|
addressesMap[lastP2wsh.address] = 'MWEB';
|
||||||
|
} else {
|
||||||
|
addressesMap[address] = 'Active - MWEB';
|
||||||
|
}
|
||||||
|
|
||||||
silentAddresses.forEach((addressRecord) {
|
silentAddresses.forEach((addressRecord) {
|
||||||
if (addressRecord.type != SilentPaymentsAddresType.p2sp || addressRecord.isHidden) {
|
if (addressRecord.type != SilentPaymentsAddresType.p2sp || addressRecord.isHidden) {
|
||||||
return;
|
return;
|
||||||
|
@ -546,10 +556,12 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
||||||
|
|
||||||
void _validateAddresses() {
|
void _validateAddresses() {
|
||||||
allAddresses.forEach((element) {
|
allAddresses.forEach((element) {
|
||||||
if (!element.isHidden && element.address !=
|
if (!element.isHidden &&
|
||||||
|
element.address !=
|
||||||
getAddress(index: element.index, hd: mainHd, addressType: element.type)) {
|
getAddress(index: element.index, hd: mainHd, addressType: element.type)) {
|
||||||
element.isHidden = true;
|
element.isHidden = true;
|
||||||
} else if (element.isHidden && element.address !=
|
} else if (element.isHidden &&
|
||||||
|
element.address !=
|
||||||
getAddress(index: element.index, hd: sideHd, addressType: element.type)) {
|
getAddress(index: element.index, hd: sideHd, addressType: element.type)) {
|
||||||
element.isHidden = false;
|
element.isHidden = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue