From f631678de7c771cdb5c3ccf71cac9b1cca6c0502 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 12 Oct 2023 17:05:17 -0600 Subject: [PATCH] change query for address slightly. Might revert --- lib/services/mixins/fusion_wallet_interface.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/services/mixins/fusion_wallet_interface.dart b/lib/services/mixins/fusion_wallet_interface.dart index 97ba4008f..1c04b4f3d 100644 --- a/lib/services/mixins/fusion_wallet_interface.dart +++ b/lib/services/mixins/fusion_wallet_interface.dart @@ -297,20 +297,28 @@ mixin FusionWalletInterface { possibleAddresses.add(bitbox.Address.toCashAddress(addressString)); } - // Find public key. + // Fetch address to get pubkey final addr = await _db .getAddresses(_walletId) .filter() .anyOf>( possibleAddresses, (q, e) => q.valueEqualTo(e)) + .and() + .group((q) => q + .subTypeEqualTo(AddressSubType.change) + .or() + .subTypeEqualTo(AddressSubType.receiving)) + .and() + .typeEqualTo(AddressType.p2pkh) .findFirst(); + // depending on the address type in the query above this can be null if (addr == null) { // A utxo object should always have a non null address. // If non found then just ignore the UTXO (aka don't fuse it) Logging.instance.log( - "Missing address=\"$addressString\" while selecting UTXOs for Fusion", - level: LogLevel.Warning, + "Ignoring utxo=$utxo for address=\"$addressString\" while selecting UTXOs for Fusion", + level: LogLevel.Info, ); continue; }