From 9386544b3d883a808d219e482e25dbb1883604af Mon Sep 17 00:00:00 2001 From: bacoinin Date: Sun, 24 Nov 2024 20:03:04 +0000 Subject: [PATCH] getUnspentsByAddr correclty retrieves unspent blind utxos --- basicswap/interface/part.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/basicswap/interface/part.py b/basicswap/interface/part.py index 8129343..9e572c1 100644 --- a/basicswap/interface/part.py +++ b/basicswap/interface/part.py @@ -166,7 +166,13 @@ class PARTInterface(BTCInterface): def getUnspentsByAddr(self): unspent_addr = dict() - unspent = self.rpc_wallet("listunspent") + balance_type = self.balance_type() + if balance_type == BalanceTypes.PLAIN: + unspent = self.rpc_wallet("listunspent") + elif balance_type == BalanceTypes.BLIND: + unspent = self.rpc_wallet("listunspentblind") + else: + raise ValueError(f"getUnspentsByAddr not implemented for {balance_type} type") for u in unspent: if u["spendable"] is not True: continue @@ -968,7 +974,7 @@ class PARTInterfaceBlind(PARTInterface): return bytes.fromhex(lock_refund_swipe_tx_hex) def getSpendableBalance(self) -> int: - return self.make_int(self.rpc_wallet("getbalances")["mine"]["blind_trusted"]) + raise ValueError("getUnspentsByAddr is used to get the Blind balances") def publishBLockTx( self,