mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Immediately fetch transaction status upon subscription
Immediately fetch transaction status upon subscription instead of waiting 1 minute
(cherry picked from commit 5662f7fe81
)
This commit is contained in:
parent
3d12631d69
commit
f09b237e15
@ -131,8 +131,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) => {
|
||||||
@ -153,6 +151,8 @@ impl Wallet {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ impl Client {
|
|||||||
electrum,
|
electrum,
|
||||||
blockchain,
|
blockchain,
|
||||||
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…
Reference in New Issue
Block a user