tdiscard channel updates too far in the future, or too close apart (see #6124) - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit ac67f7ae30b2a84d7a1ce44bcb03e4b20292a443 DIR parent 1322fa6a08f6c591a1911b233e7d6b509c09538a HTML Author: ThomasV <thomasv@electrum.org> Date: Sun, 10 May 2020 12:16:16 +0200 discard channel updates too far in the future, or too close apart (see #6124) Diffstat: M electrum/channel_db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/channel_db.py b/electrum/channel_db.py t@@ -404,6 +404,8 @@ class ChannelDB(SqlDB): timestamp = payload['timestamp'] if max_age and now - timestamp > max_age: return UpdateStatus.EXPIRED + if timestamp - now > 60: + return UpdateStatus.DEPRECATED channel_info = self._channels.get(short_channel_id) if not channel_info: return UpdateStatus.ORPHANED t@@ -417,7 +419,7 @@ class ChannelDB(SqlDB): short_channel_id = ShortChannelID(payload['short_channel_id']) key = (start_node, short_channel_id) old_policy = self._policies.get(key) - if old_policy and timestamp <= old_policy.timestamp: + if old_policy and timestamp <= old_policy.timestamp + 60: return UpdateStatus.DEPRECATED if verify: self.verify_channel_update(payload)