update ref and throw on null addr (addr!.publicKey throws)

This commit is contained in:
sneurlax 2023-10-12 14:32:01 -05:00
parent 4db1d0b9c2
commit 7c1c1cba7d
2 changed files with 7 additions and 3 deletions

@ -1 +1 @@
Subproject commit c7e9521a03aa8e6e0b11134027d6ea301acbc273
Subproject commit 2908a9599c0f15e04e14d90e3303bb84e83de121

View file

@ -287,14 +287,18 @@ mixin FusionWalletInterface {
for (final utxo in walletUtxos) {
// Check if address is available.
if (utxo.address == null) {
// A utxo object should always have a non null address
// as per the db query above
// A utxo object should always have a non null address.
throw Exception("UTXO ${utxo.txid}:${utxo.vout} address is null");
}
// Find public key.
final addr = await _db.getAddress(_walletId, utxo.address!);
if (addr == null) {
// A utxo object should always have a non null address.
throw Exception("UTXO ${utxo.txid}:${utxo.vout} address not found");
}
final dto = fusion.UtxoDTO(
txid: utxo.txid,
vout: utxo.vout,