diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py
index a9fa088..f80cf47 100644
--- a/basicswap/basicswap.py
+++ b/basicswap/basicswap.py
@@ -42,7 +42,6 @@ from .util import (
LockedCoinError,
TemporaryError,
InactiveCoin,
- format_amount,
format_timestamp,
DeserialiseNum,
zeroIfNone,
@@ -6584,16 +6583,18 @@ class BasicSwap(BaseApp):
try:
walletinfo = ci.getWalletInfo()
- scale = chainparams[coin]['decimal_places']
rv = {
'deposit_address': self.getCachedAddressForCoin(coin),
- 'balance': format_amount(make_int(walletinfo['balance'], scale), scale),
- 'unconfirmed': format_amount(make_int(walletinfo.get('unconfirmed_balance'), scale), scale),
+ 'balance': ci.format_amount(walletinfo['balance'], conv_int=True),
+ 'unconfirmed': ci.format_amount(walletinfo['unconfirmed_balance'], conv_int=True),
'expected_seed': ci.knownWalletSeed(),
'encrypted': walletinfo['encrypted'],
'locked': walletinfo['locked'],
}
+ if 'immature_balance' in walletinfo:
+ rv['immature'] = ci.format_amount(walletinfo['immature_balance'], conv_int=True)
+
if 'locked_utxos' in walletinfo:
rv['locked_utxos'] = walletinfo['locked_utxos']
@@ -6611,7 +6612,6 @@ class BasicSwap(BaseApp):
rv['mweb_address'] = self.getCachedStealthAddressForCoin(Coins.LTC_MWEB)
rv['mweb_balance'] = walletinfo['mweb_balance']
rv['mweb_pending'] = walletinfo['mweb_unconfirmed'] + walletinfo['mweb_immature']
- rv['mweb_pending'] = walletinfo['mweb_unconfirmed'] + walletinfo['mweb_immature']
return rv
except Exception as e:
diff --git a/basicswap/rpc.py b/basicswap/rpc.py
index 782d770..8ac5561 100644
--- a/basicswap/rpc.py
+++ b/basicswap/rpc.py
@@ -23,10 +23,7 @@ from .util import jsonDecimal
def waitForRPC(rpc_func, expect_wallet=True, max_tries=7):
for i in range(max_tries + 1):
try:
- if expect_wallet:
- rpc_func('getwalletinfo')
- else:
- rpc_func('getblockchaininfo')
+ rpc_func('getwalletinfo' if expect_wallet else 'getblockchaininfo')
return
except Exception as ex:
if i < max_tries:
diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html
index b23042e..d807f14 100644
--- a/basicswap/templates/wallet.html
+++ b/basicswap/templates/wallet.html
@@ -141,7 +141,7 @@
Balance:
-
Error: {{ w.error }}
+ {% for w in wallets %} + {% if w.havedata %} + {% if w.error %}Error: {{ w.error }}
{% else %}