Do not trace events meant for other NBs

This commit is contained in:
Tobin C. Harding 2020-10-29 10:22:31 +11:00 committed by Lucas Soriano del Pino
parent c464555f5e
commit 3e2f0b74a2
12 changed files with 58 additions and 50 deletions

View file

@ -94,6 +94,8 @@ pub async fn swap(
}
}
debug!("swapping ...");
let mut swarm = new_swarm(listen, local_port)?;
let message0: bob::Message0;
let mut last_amounts: Option<SwapAmounts> = None;
@ -112,6 +114,7 @@ pub async fn swap(
swarm.send_amounts(channel, amounts);
}
OutEvent::Message0(msg) => {
debug!("got message 0 from Bob");
// We don't want Bob to be able to crash us by sending an out of
// order message. Keep looping if Bob has not requested amounts.
if last_amounts.is_some() {