Merge pull request #457 from ariard/2020-01-fix-append-onchain

Fix spurious calls of broadcast_by_local_state
This commit is contained in:
Matt Corallo 2020-01-22 20:57:36 +00:00 committed by GitHub
commit 9a02115437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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 { .. } => { }
}