Merge pull request #457 from ariard/2020-01-fix-append-onchain
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Wed, 22 Jan 2020 20:57:36 +0000 (20:57 +0000)
committerGitHub <noreply@github.com>
Wed, 22 Jan 2020 20:57:36 +0000 (20:57 +0000)
Fix spurious calls of broadcast_by_local_state

lightning/src/ln/channelmonitor.rs

index 70f11405d0cb8399beb1c540acbe84ff20955982..dada0bcb45d43905bb19a0c4657b18a3cc0aa74a 100644 (file)
@@ -2219,7 +2219,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 { .. } => { }
                                }
@@ -2242,7 +2243,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 { .. } => { }
                                }