Changed way for generation of change address for electrum wallets. Remove some yats call.

This commit is contained in:
M
2022-01-12 15:20:43 +02:00
parent 862401147b
commit cfb82dd02d
8 changed files with 93 additions and 54 deletions
@@ -77,16 +77,16 @@ abstract class WalletAddressListViewModelBase with Store {
}
});
reaction((_) => yatStore.emoji, (String emojiId) => this.emoji = emojiId);
//reaction((_) => yatStore.emoji, (String emojiId) => this.emoji = emojiId);
_onLastUsedYatAddressSubscription =
_wallet.walletInfo.yatLastUsedAddressStream.listen((String yatAddress) {
if (yatAddress == _wallet.walletAddresses.address) {
emoji = yatStore.emoji;
} else {
emoji = '';
}
});
//_onLastUsedYatAddressSubscription =
// _wallet.walletInfo.yatLastUsedAddressStream.listen((String yatAddress) {
// if (yatAddress == _wallet.walletAddresses.address) {
// emoji = yatStore.emoji;
// } else {
// emoji = '';
// }
//});
if (_wallet.walletAddresses.address == _wallet.walletInfo.yatLastUsedAddress) {
emoji = yatStore.emoji;
@@ -223,4 +223,15 @@ abstract class WalletAddressListViewModelBase with Store {
wallet.save();
}
}
@action
void generateRandomAddress() {
final wallet = _wallet;
if (wallet.type == WalletType.bitcoin
|| wallet.type == WalletType.litecoin) {
bitcoin.randomAddress(wallet);
wallet.save();
}
}
}