From 4c9d1e8d8d1ac6444ae0ab01b8a46cdceef08978 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:24:27 +0200 Subject: [PATCH] Reduce check interval for Monero `watch_for_transfer` (#1670) Oftentimes we fail to check the status of the Monero transaction on the first try (because it hasn't been registered on our Monero daemon yet, it takes a few seconds). By decreasing the check interval from the default of 2 minutes to a 10th of that, we ensure that Bob get's his transfer proof faster. --- swap/src/monero/wallet.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swap/src/monero/wallet.rs b/swap/src/monero/wallet.rs index 99fa206a6..e3db3416a 100644 --- a/swap/src/monero/wallet.rs +++ b/swap/src/monero/wallet.rs @@ -6,6 +6,7 @@ use ::monero::{Address, Network, PrivateKey, PublicKey}; use anyhow::{Context, Result}; use monero_rpc::wallet::{BlockHeight, MoneroWalletRpc as _, Refreshed}; use monero_rpc::{jsonrpc, wallet}; +use std::ops::Div; use std::str::FromStr; use std::time::Duration; use tokio::sync::Mutex; @@ -233,7 +234,7 @@ impl Wallet { let address = Address::standard(self.network, public_spend_key, public_view_key.into()); - let check_interval = tokio::time::interval(self.sync_interval); + let check_interval = tokio::time::interval(self.sync_interval.div(10)); wait_for_confirmations( &self.inner,