merge clean up

This commit is contained in:
julian 2023-02-02 09:41:33 -06:00
parent dc581cd4fc
commit b2d7414cb6

View file

@ -633,6 +633,13 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
p2shChangeAddressArray.add(address);
}
final addressesToStore = [
...bip44P2pkhReceiveAddressArray,
...bip44P2pkhChangeAddressArray,
...p2shReceiveAddressArray,
...p2shChangeAddressArray,
];
if (!testnet) {
final resultReceiveBch44 = _checkGaps(
maxNumberOfIndexesToCheck,
@ -691,41 +698,16 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
bch44P2pkhChangeAddressArray.add(address);
}
if (isRescan) {
await db.updateOrPutAddresses([
...bip44P2pkhReceiveAddressArray,
...bip44P2pkhChangeAddressArray,
addressesToStore.addAll([
...bch44P2pkhReceiveAddressArray,
...bch44P2pkhChangeAddressArray,
...p2shReceiveAddressArray,
...p2shChangeAddressArray,
]);
} else {
await db.putAddresses([
...bip44P2pkhReceiveAddressArray,
...bip44P2pkhChangeAddressArray,
...bch44P2pkhReceiveAddressArray,
...bch44P2pkhChangeAddressArray,
...p2shReceiveAddressArray,
...p2shChangeAddressArray,
]);
}
} else {
if (isRescan) {
await db.updateOrPutAddresses([
...bip44P2pkhReceiveAddressArray,
...bip44P2pkhChangeAddressArray,
...p2shReceiveAddressArray,
...p2shChangeAddressArray,
]);
await db.updateOrPutAddresses(addressesToStore);
} else {
await db.putAddresses([
...bip44P2pkhReceiveAddressArray,
...bip44P2pkhChangeAddressArray,
...p2shReceiveAddressArray,
...p2shChangeAddressArray,
]);
}
await db.putAddresses(addressesToStore);
}
await _updateUTXOs();