Skip to content

Commit

Permalink
Reduce check interval for Monero watch_for_transfer (#1670)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
binarybaron authored Jun 27, 2024
1 parent 21fed8c commit 4c9d1e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swap/src/monero/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4c9d1e8

Please sign in to comment.