Parcourir la source

node/state: Reduce scope of pubkey variable in apply().

parazyd il y a 4 ans
Parent
commit
5ba78d6967
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/node/state.rs

+ 2 - 2
src/node/state.rs

@@ -160,9 +160,9 @@ impl State {
 
                     wallet.put_own_coin(own_coin).await?;
 
-                    let pubkey = PublicKey::from_secret(*secret);
-                    debug!(target: "state_apply", "Send a notification");
                     if let Some(ch) = notify.clone() {
+                        debug!(target: "state_apply", "Send a notification");
+                        let pubkey = PublicKey::from_secret(*secret);
                         ch.send((pubkey, note.value)).await?;
                     }
                 }