diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0061673..6be7e1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ concurrency: env: BIN_DIR: /tmp/cached_bin - TEST_RELOAD_PATH: /tmp/test_basicswap1 + TEST_RELOAD_PATH: /tmp/test_basicswap jobs: ci: @@ -46,8 +46,8 @@ jobs: cache-name: cache-cores CACHE_KEY: $(printf $(python bin/basicswap-prepare.py --version --withcoins=bitcoin) | sha256sum | head -c 64) with: - path: "$BIN_DIR" - key: "$CACHE_KEY" + path: $BIN_DIR + key: $CACHE_KEY - if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }} name: Running basicswap-prepare @@ -57,6 +57,6 @@ jobs: run: | export PYTHONPATH=$(pwd) export TEST_PATH=${TEST_RELOAD_PATH} - mkdir -p ${TEST_RELOAD_PATH}/bin - cp -r $BIN_DIR/* ${TEST_RELOAD_PATH}/bin/ + mkdir -p ${TEST_PATH}/bin + cp -r $BIN_DIR/* ${TEST_PATH}/bin/ pytest tests/basicswap/extended/test_encrypted_xmr_reload.py diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index d327513..2367f04 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -8767,10 +8767,10 @@ class BasicSwap(BaseApp): try: chain_height = ci_to.getChainHeight() - lock_tx_depth = (chain_height - bid.xmr_b_lock_tx.chain_height) + 1 + lock_tx_depth = (chain_height - bid.xmr_b_lock_tx.chain_height) if lock_tx_depth < ci_to.depth_spendable(): raise TemporaryError( - f"Chain B lock tx depth {lock_tx_depth} < required for spending." + f"Chain B lock tx still confirming {lock_tx_depth} / {ci_to.depth_spendable()}." ) if TxTypes.BCH_MERCY in bid.txns: @@ -8857,9 +8857,7 @@ class BasicSwap(BaseApp): ): delay = self.get_delay_retry_seconds() self.log.info( - "Retrying sending adaptor-sig swap chain B spend tx for bid %s in %d seconds", - bid_id.hex(), - delay, + f"Retrying sending adaptor-sig swap chain B spend tx for bid {bid_id.hex()} in {delay} seconds" ) self.createActionInSession( delay, ActionTypes.REDEEM_XMR_SWAP_LOCK_TX_B, bid_id, cursor @@ -10285,6 +10283,9 @@ class BasicSwap(BaseApp): "locked": walletinfo["locked"], } + if "wallet_blocks" in walletinfo: + rv["wallet_blocks"] = walletinfo["wallet_blocks"] + if "immature_balance" in walletinfo: rv["immature"] = ci.format_amount( walletinfo["immature_balance"], conv_int=True diff --git a/basicswap/bin/prepare.py b/basicswap/bin/prepare.py index f1909d9..2cbe01e 100644 --- a/basicswap/bin/prepare.py +++ b/basicswap/bin/prepare.py @@ -1520,7 +1520,9 @@ def printVersion(with_coins): if len(with_coins) < 1: return print("Core versions:") - with_coins_changed: bool = False if len(with_coins) == 1 and "particl" in with_coins else True + with_coins_changed: bool = ( + False if len(with_coins) == 1 and "particl" in with_coins else True + ) for coin, version in known_coins.items(): if with_coins_changed and coin not in with_coins: continue diff --git a/basicswap/interface/xmr.py b/basicswap/interface/xmr.py index 1b0dfc5..bf5c21f 100644 --- a/basicswap/interface/xmr.py +++ b/basicswap/interface/xmr.py @@ -292,6 +292,7 @@ class XMRInterface(CoinInterface): rv = {} balance_info = self.rpc_wallet("get_balance") + rv["wallet_blocks"] = self.rpc_wallet("get_height")["height"] rv["balance"] = self.format_amount(balance_info["unlocked_balance"]) rv["unconfirmed_balance"] = self.format_amount( balance_info["balance"] - balance_info["unlocked_balance"] diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html index aca5281..05943fc 100644 --- a/basicswap/templates/wallet.html +++ b/basicswap/templates/wallet.html @@ -163,6 +163,12 @@ {% endif %} + {% if w.wallet_blocks %} +