From 8f5a989ad16679d0464b2cb3bdd2a4a46421b8cd Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 27 Oct 2020 10:05:20 +1100 Subject: [PATCH] Use 'amounts' for local varibale name --- swap/src/alice.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/swap/src/alice.rs b/swap/src/alice.rs index 2a5b8f66..775020dd 100644 --- a/swap/src/alice.rs +++ b/swap/src/alice.rs @@ -46,9 +46,11 @@ pub async fn swap( } OutEvent::Request(amounts::OutEvent::Btc { btc, channel }) => { debug!("Got request from Bob to swap {}", btc); - let p = calculate_amounts(btc); - last_amounts = Some(p); - swarm.send_amounts(channel, p); + let amounts = calculate_amounts(btc); + // TODO: We cache the last amounts returned, this needs improving along with + // verification of message 0. + last_amounts = Some(amounts); + swarm.send_amounts(channel, amounts); } OutEvent::Message0(msg) => { // We don't want Bob to be able to crash us by sending an out of