Introduce a minimum buy amount

Introduces a minimum buy Bitcoin amount similar to the maximum amount already present.
For the CLI the minimum amount is enforced by waiting until at least the minimum is available as max-giveable amount.
This commit is contained in:
Daniel Karzel 2021-05-07 19:06:58 +10:00
parent 6d3cf0af91
commit 652aae9590
No known key found for this signature in database
GPG key ID: 30C3FC2E438ADB6E
12 changed files with 319 additions and 81 deletions

View file

@ -226,6 +226,7 @@ async fn start_alice(
let current_balance = monero_wallet.get_balance().await.unwrap();
let lock_fee = monero_wallet.static_tx_fee_estimate();
let min_buy = bitcoin::Amount::from_sat(u64::MIN);
let max_buy = bitcoin::Amount::from_sat(u64::MAX);
let latest_rate = FixedRate::default();
let resume_only = false;
@ -234,6 +235,7 @@ async fn start_alice(
&seed,
current_balance,
lock_fee,
min_buy,
max_buy,
latest_rate,
resume_only,
@ -248,7 +250,8 @@ async fn start_alice(
monero_wallet,
db,
FixedRate::default(),
bitcoin::Amount::ONE_BTC,
min_buy,
max_buy,
)
.unwrap();