Add a mandatory --change-address parameter to buy-xmr

Fixes #513.
This commit is contained in:
Thomas Eizinger 2021-07-06 19:17:17 +10:00
parent 683d565679
commit 5463bde4f8
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
12 changed files with 135 additions and 13 deletions

View file

@ -61,8 +61,10 @@ async fn next_state(
tracing::trace!(%state, "Advancing state");
Ok(match state {
BobState::Started { btc_amount } => {
let bitcoin_refund_address = bitcoin_wallet.new_address().await?;
BobState::Started {
btc_amount,
change_address,
} => {
let tx_refund_fee = bitcoin_wallet
.estimate_fee(TxRefund::weight(), btc_amount)
.await?;
@ -76,7 +78,7 @@ async fn next_state(
btc: btc_amount,
tx_refund_fee,
tx_cancel_fee,
bitcoin_refund_address,
bitcoin_refund_address: change_address,
})
.await?;