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

@ -25,6 +25,7 @@ use uuid::Uuid;
pub enum BobState {
Started {
btc_amount: bitcoin::Amount,
change_address: bitcoin::Address,
},
SwapSetupCompleted(State2),
BtcLocked(State3),
@ -169,7 +170,14 @@ impl State0 {
bail!("Alice's dleq proof doesn't verify")
}
let tx_lock = bitcoin::TxLock::new(wallet, self.btc, msg.A, self.b.public()).await?;
let tx_lock = bitcoin::TxLock::new(
wallet,
self.btc,
msg.A,
self.b.public(),
self.refund_address.clone(),
)
.await?;
let v = msg.v_a + self.v_b;
Ok(State1 {