mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-03 09:19:26 +00:00
Add incoming mweb->plain amounts to unconfirmed balance
This commit is contained in:
parent
6e4feb33d7
commit
a6e7d36e84
1 changed files with 7 additions and 0 deletions
|
@ -39,6 +39,13 @@ class LTCInterface(BTCInterface):
|
||||||
rv['mweb_balance'] = mweb_info['balance']
|
rv['mweb_balance'] = mweb_info['balance']
|
||||||
rv['mweb_unconfirmed'] = mweb_info['unconfirmed_balance']
|
rv['mweb_unconfirmed'] = mweb_info['unconfirmed_balance']
|
||||||
rv['mweb_immature'] = mweb_info['immature_balance']
|
rv['mweb_immature'] = mweb_info['immature_balance']
|
||||||
|
|
||||||
|
# Add unconfirmed mweb -> plain txns to the unconfirmed_balance
|
||||||
|
txns = self.rpc_wallet('listtransactions')
|
||||||
|
for tx in reversed(txns):
|
||||||
|
amount: float = tx.get('amount', 0.0)
|
||||||
|
if tx['confirmations'] == 0 and tx.get('mweb_out', None) and amount > 0.0:
|
||||||
|
rv['unconfirmed_balance'] += amount
|
||||||
return rv
|
return rv
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue