mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Don't spam the user while waiting for BTC
This commit is contained in:
parent
56a48e71ef
commit
cacfc50fb2
@ -446,28 +446,26 @@ where
|
|||||||
"Waiting for Bitcoin deposit",
|
"Waiting for Bitcoin deposit",
|
||||||
);
|
);
|
||||||
|
|
||||||
sync().await?;
|
max_giveable = loop {
|
||||||
|
sync().await?;
|
||||||
|
let new_max_givable = max_giveable_fn().await?;
|
||||||
|
|
||||||
let new_max_givable = max_giveable_fn().await?;
|
if new_max_givable > max_giveable {
|
||||||
|
break new_max_givable;
|
||||||
if new_max_givable != max_giveable {
|
|
||||||
max_giveable = new_max_givable;
|
|
||||||
|
|
||||||
let new_balance = balance().await?;
|
|
||||||
tracing::info!(
|
|
||||||
%new_balance,
|
|
||||||
%max_giveable,
|
|
||||||
"Received Bitcoin",
|
|
||||||
);
|
|
||||||
|
|
||||||
if max_giveable >= bid_quote.min_quantity {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
tracing::info!("Deposited amount is less than `min_quantity`",);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||||
|
};
|
||||||
|
|
||||||
|
let new_balance = balance().await?;
|
||||||
|
tracing::info!(%new_balance, %max_giveable, "Received Bitcoin");
|
||||||
|
|
||||||
|
if max_giveable < bid_quote.min_quantity {
|
||||||
|
tracing::info!("Deposited amount is less than `min_quantity`");
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user