From 0ac4bbabe33fdb4aea1df7c52aada8cb3332c6b6 Mon Sep 17 00:00:00 2001 From: Mohan <86064887+binarybaron@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:12:21 +0200 Subject: [PATCH] fix(bob): Only warn if .expired_timelock(..) check fails in BtcLocked state (#393) --- swap/src/protocol/bob/swap.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index 381b3177..13075eaa 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -232,10 +232,14 @@ async fn next_state( // Check explicitly whether the cancel timelock has expired // (Most likely redundant but cannot hurt) - if state3 + // We only warn if this fails + if let Ok(true) = state3 .expired_timelock(bitcoin_wallet) - .await? - .cancel_timelock_expired() + .await + .inspect_err(|err| { + tracing::warn!(?err, "Failed to check for cancel timelock expiration"); + }) + .map(|expired_timelocks| expired_timelocks.cancel_timelock_expired()) { let state4 = state3.cancel(monero_wallet_restore_blockheight); return Ok(BobState::CancelTimelockExpired(state4));