mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-09 12:19:29 +00:00
getUnspentsByAddr correclty retrieves unspent blind utxos
This commit is contained in:
parent
3e3a83e6d4
commit
9386544b3d
1 changed files with 8 additions and 2 deletions
|
@ -166,7 +166,13 @@ class PARTInterface(BTCInterface):
|
||||||
|
|
||||||
def getUnspentsByAddr(self):
|
def getUnspentsByAddr(self):
|
||||||
unspent_addr = dict()
|
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:
|
for u in unspent:
|
||||||
if u["spendable"] is not True:
|
if u["spendable"] is not True:
|
||||||
continue
|
continue
|
||||||
|
@ -968,7 +974,7 @@ class PARTInterfaceBlind(PARTInterface):
|
||||||
return bytes.fromhex(lock_refund_swipe_tx_hex)
|
return bytes.fromhex(lock_refund_swipe_tx_hex)
|
||||||
|
|
||||||
def getSpendableBalance(self) -> int:
|
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(
|
def publishBLockTx(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in a new issue