From: Matt Corallo Date: Tue, 25 Feb 2020 18:32:13 +0000 (-0500) Subject: Use block timestamps as the min for generated update messages. X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=122b75eac7b1c68ac6cc1fe4dc23fad8ac2389c0;p=rust-lightning Use block timestamps as the min for generated update messages. Fixes issue #493 and should resolve some issues where other nodes (incorrectly) reject channel_update/node_announcement messages which have a serial number that is not a relatively recent timestamp. --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index f155a0bd2..b0f544503 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -3175,6 +3175,7 @@ impl Channel { } if header.bitcoin_hash() != self.last_block_connected { self.last_block_connected = header.bitcoin_hash(); + self.channel_update_count = cmp::max(self.channel_update_count, header.time); if let Some(channel_monitor) = self.channel_monitor.as_mut() { channel_monitor.last_block_hash = self.last_block_connected; } diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 784173e13..3a53c3f4a 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -2758,6 +2758,16 @@ impl