coin control edge cases

This commit is contained in:
Matthew Fosse 2024-07-19 00:06:23 -07:00
parent 964f66c74a
commit 399d0cab8b
2 changed files with 10 additions and 1 deletions

View file

@ -1168,7 +1168,7 @@ abstract class ElectrumWalletBase
Future<void> updateUnspent() async {
await updateAllUnspents();
if (unspentCoinsInfo.isEmpty) {
if (unspentCoinsInfo.length != unspentCoins.length) {
unspentCoins.forEach((coin) => addCoinInfo(coin));
return;
}

View file

@ -205,6 +205,7 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
}
});
processMwebUtxos();
updateUnspent();
}
@action
@ -514,6 +515,12 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
});
}
print(unspentCoins);
print(updatedUnspentCoins);
print(updatedUnspentCoins.length);
// print(updatedUnspentCoins[2].address);
unspentCoins = updatedUnspentCoins;
}
@ -575,6 +582,8 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
}
}
await updateUnspent();
return ElectrumBalance(confirmed: confirmed, unconfirmed: unconfirmed, frozen: balance.frozen);
}