Skip to content

Commit 6910d6d

Browse files
committed
refactor
1 parent 46dd04b commit 6910d6d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

swap/src/protocol/alice/swap.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ where
137137
let monero_wallet_restore_blockheight = monero_wallet
138138
.block_height()
139139
.await
140-
.inspect_err(|e| {
141-
tracing::warn!(
142-
swap_id = %swap_id,
143-
error = ?e,
144-
"Failed to get Monero wallet block height while trying to lock XMR. We will retry."
145-
)
146-
})
147140
.context("Failed to get Monero wallet block height")
148141
.map_err(backoff::Error::transient)?;
149142

@@ -284,16 +277,15 @@ where
284277
let tx_lock_status = bitcoin_wallet.subscribe_to(state3.tx_lock.clone()).await;
285278
match state3.signed_redeem_transaction(*encrypted_signature) {
286279
Ok(tx) => {
287-
// We will retry indefinitely to publish the redeem transaction, until the cancel timelock expires
288-
// We might not be able to publish the redeem transaction on the first try due to any number of reasons
280+
// Retry indefinitely to publish the redeem transaction, until the cancel timelock expires
281+
// Publishing the redeem transaction might fail on the first try due to any number of reasons
289282
let backoff = backoff::ExponentialBackoffBuilder::new()
290283
.with_max_elapsed_time(None)
291284
.with_max_interval(Duration::from_secs(60))
292285
.build();
293286

294287
match backoff::future::retry_notify(backoff.clone(), || async {
295-
// If the cancel timelock is expired, we do not need to publish anymore
296-
// We cannot use a tokio::select! here because this is not cancellation safe
288+
// If the cancel timelock is expired, there is no need to try to publish the redeem transaction anymore
297289
if !matches!(
298290
state3.expired_timelocks(bitcoin_wallet).await?,
299291
ExpiredTimelocks::None { .. }

0 commit comments

Comments
 (0)