]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix spurious calls of broadcast_by_local_state
authorAntoine Riard <ariard@student.42.fr>
Wed, 22 Jan 2020 18:53:12 +0000 (13:53 -0500)
committerAntoine Riard <ariard@student.42.fr>
Wed, 22 Jan 2020 18:53:12 +0000 (13:53 -0500)
lightning/src/ln/channelmonitor.rs

index b9527f599b246552056cd5b98a6866c0fb4514f8..66e73a22d2e53b104372ac526c625aecc29b3d70 100644 (file)
@@ -2220,7 +2220,8 @@ impl ChannelMonitor {
                                assert!(local_tx.tx.has_local_sig());
                                match self.key_storage {
                                        Storage::Local { ref delayed_payment_base_key, .. } => {
-                                               append_onchain_update!(self.broadcast_by_local_state(local_tx, delayed_payment_base_key, height));
+                                               let mut res = self.broadcast_by_local_state(local_tx, delayed_payment_base_key, height);
+                                               append_onchain_update!(res);
                                        },
                                        Storage::Watchtower { .. } => { }
                                }
@@ -2243,7 +2244,8 @@ impl ChannelMonitor {
                                assert!(local_tx.tx.has_local_sig());
                                match self.key_storage {
                                        Storage::Local { ref delayed_payment_base_key, .. } => {
-                                               append_onchain_update!(self.broadcast_by_local_state(local_tx, delayed_payment_base_key, height));
+                                               let mut res = self.broadcast_by_local_state(local_tx, delayed_payment_base_key, height);
+                                               append_onchain_update!(res);
                                        },
                                        Storage::Watchtower { .. } => { }
                                }