decred / dcrlnd

Decred Lightning Network Daemon ⚡️
MIT License
36 stars 24 forks source link

Fix gossip timestamps set to a future date #211

Closed matheusd closed 6 months ago

matheusd commented 6 months ago

This fixes an issue in the deployed network where nodes sending ChannelUpdates and NodeAnnouncements set to a future timestamp could cause the gossip syncer to fail to fetch new announcements.

The issue stems from the fact that the gossip syncer stores the timestamp of the last received message and uses that, upon restart, to fetch new messages. An update with a timestamp in the future propagating through the network would cause the syncer to fail to fetch new updates.

This PR fixes the issue by amending the handling of future timestamps in the syncer and by performing a database migration that rewinds any timestamps stored that are set to a future date.