mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-09-22 22:04:50 -04:00
Merge #1188
1188: Immediately fetch transaction status upon subscription r=delta1 a=binarybaron Immediately fetch transaction status upon subscription instead of waiting 1 minute before making call to electrum server Co-authored-by: Byron Hambly <bhambly@blockstream.com> Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
This commit is contained in:
commit
48f4fdb143
1 changed files with 3 additions and 3 deletions
|
@ -143,8 +143,6 @@ impl Wallet {
|
||||||
let mut last_status = None;
|
let mut last_status = None;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
|
||||||
|
|
||||||
let new_status = match client.lock().await.status_of_script(&tx) {
|
let new_status = match client.lock().await.status_of_script(&tx) {
|
||||||
Ok(new_status) => new_status,
|
Ok(new_status) => new_status,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
@ -165,6 +163,8 @@ impl Wallet {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ impl Client {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
electrum,
|
electrum,
|
||||||
latest_block_height: BlockHeight::try_from(latest_block)?,
|
latest_block_height: BlockHeight::try_from(latest_block)?,
|
||||||
last_sync: Instant::now(),
|
last_sync: Instant::now() - interval,
|
||||||
sync_interval: interval,
|
sync_interval: interval,
|
||||||
script_history: Default::default(),
|
script_history: Default::default(),
|
||||||
subscriptions: Default::default(),
|
subscriptions: Default::default(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue