Timeout for Alice waiting for ack for sending transfer proof

If dialing Bob fails Alice waits for the acknowledgement of the transfer proof indefinitely.
The timout prevents her execution from hanging.
Added a ToDo to re-visit the ack receivers. They don't add value at the moment and should be removed.
This commit is contained in:
Daniel Karzel 2021-02-01 18:14:53 +11:00
parent c9adbde5d5
commit 2d5d70d856
4 changed files with 36 additions and 14 deletions

View file

@ -96,6 +96,7 @@ pub async fn lock_xmr<W>(
state3: alice::State3,
event_loop_handle: &mut EventLoopHandle,
monero_wallet: Arc<W>,
execution_params: ExecutionParams,
) -> Result<()>
where
W: Transfer,
@ -117,9 +118,13 @@ where
// Otherwise Alice might publish the lock tx twice!
event_loop_handle
.send_transfer_proof(bob_peer_id, TransferProof {
tx_lock_proof: transfer_proof,
})
.send_transfer_proof(
bob_peer_id,
TransferProof {
tx_lock_proof: transfer_proof,
},
execution_params,
)
.await?;
Ok(())