From a6e7d36e8483a17d24b7e3db16ea9df27ff69cca Mon Sep 17 00:00:00 2001 From: tecnovert Date: Fri, 9 Feb 2024 23:37:26 +0200 Subject: [PATCH] Add incoming mweb->plain amounts to unconfirmed balance --- basicswap/interface/ltc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/basicswap/interface/ltc.py b/basicswap/interface/ltc.py index 6dc1ddf..7892b25 100644 --- a/basicswap/interface/ltc.py +++ b/basicswap/interface/ltc.py @@ -39,6 +39,13 @@ class LTCInterface(BTCInterface): rv['mweb_balance'] = mweb_info['balance'] rv['mweb_unconfirmed'] = mweb_info['unconfirmed_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