mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-06-30 16:41:21 +00:00
Use correct variable name
This commit is contained in:
parent
c316ea5244
commit
9ae050abf8
|
@ -377,11 +377,11 @@ async fn run_until_internal(
|
||||||
pub async fn negotiate(
|
pub async fn negotiate(
|
||||||
state0: crate::protocol::bob::state::State0,
|
state0: crate::protocol::bob::state::State0,
|
||||||
amounts: SwapAmounts,
|
amounts: SwapAmounts,
|
||||||
swarm: &mut EventLoopHandle,
|
event_loop_handle: &mut EventLoopHandle,
|
||||||
bitcoin_wallet: Arc<crate::bitcoin::Wallet>,
|
bitcoin_wallet: Arc<crate::bitcoin::Wallet>,
|
||||||
) -> Result<bob::state::State2> {
|
) -> Result<bob::state::State2> {
|
||||||
tracing::trace!("Starting negotiate");
|
tracing::trace!("Starting negotiate");
|
||||||
swarm
|
event_loop_handle
|
||||||
.send_swap_request(SwapRequest {
|
.send_swap_request(SwapRequest {
|
||||||
btc_amount: amounts.btc,
|
btc_amount: amounts.btc,
|
||||||
})
|
})
|
||||||
|
@ -389,17 +389,23 @@ pub async fn negotiate(
|
||||||
|
|
||||||
// TODO: Use this once Bob's CLI is modified to only pass xmr amount in
|
// TODO: Use this once Bob's CLI is modified to only pass xmr amount in
|
||||||
// argument.
|
// argument.
|
||||||
let _swap_response = swarm.recv_swap_response().await?;
|
let _swap_response = event_loop_handle.recv_swap_response().await?;
|
||||||
|
|
||||||
swarm.send_message0(state0.next_message()).await?;
|
event_loop_handle
|
||||||
let msg0 = swarm.recv_message0().await?;
|
.send_message0(state0.next_message())
|
||||||
|
.await?;
|
||||||
|
let msg0 = event_loop_handle.recv_message0().await?;
|
||||||
let state1 = state0.receive(bitcoin_wallet.as_ref(), msg0).await?;
|
let state1 = state0.receive(bitcoin_wallet.as_ref(), msg0).await?;
|
||||||
|
|
||||||
swarm.send_message1(state1.next_message()).await?;
|
event_loop_handle
|
||||||
let msg1 = swarm.recv_message1().await?;
|
.send_message1(state1.next_message())
|
||||||
|
.await?;
|
||||||
|
let msg1 = event_loop_handle.recv_message1().await?;
|
||||||
let state2 = state1.receive(msg1)?;
|
let state2 = state1.receive(msg1)?;
|
||||||
|
|
||||||
swarm.send_message2(state2.next_message()).await?;
|
event_loop_handle
|
||||||
|
.send_message2(state2.next_message())
|
||||||
|
.await?;
|
||||||
|
|
||||||
Ok(state2)
|
Ok(state2)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user