getUnspentsByAddr correclty retrieves unspent blind utxos

This commit is contained in:
bacoinin 2024-11-24 20:03:04 +00:00
parent 3e3a83e6d4
commit 9386544b3d

View file

@ -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,