lnd/discovery
yyforyongyu 37799b95b7
discovery: fix state transition in GossipSyncer
Previously, we would set the state of the syncer after sending the msg,
which has the following flow,

1. In state `queryNewChannels`, we send the msg `QueryShortChanIDs`.
2. Once the msg is sent, we change to state `waitingQueryChanReply`.

But there's no guarantee the remote won't reply back inbetween the two
step. When that happens, our syncer would still be in state
`queryNewChannels`, causing the following error,
```
[ERR] DISC gossiper.go:873: Process query msg from peer [Alice] got unexpected msg *lnwire.ReplyShortChanIDsEnd received in state queryNewChannels
```

To fix it, we now make sure the state is updated before sending the msg.
2025-03-10 16:58:16 +08:00
..
ban.go discovery: add banman for channel announcements 2024-08-27 14:11:06 -04:00
ban_test.go discovery: add banman for channel announcements 2024-08-27 14:11:06 -04:00
bootstrapper.go multi: add SpewLogClosure to avoid code repetition 2024-07-25 22:18:49 +08:00
chan_series.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
gossiper.go discovery: grab channel mutex before any DB calls 2025-03-05 14:12:55 +02:00
gossiper_test.go discovery: grab channel mutex before any DB calls 2025-03-05 14:12:55 +02:00
log.go multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
message_store.go multi: rename ChannelUpdate to ChannelUpdate1 2024-09-18 16:13:17 +02:00
message_store_test.go multi: rename chan DB Open method to OpenForTesting 2024-11-28 13:51:15 +02:00
mock_test.go discovery: implement ChannelAnnouncement banning 2024-08-27 14:11:06 -04:00
reliable_sender.go discovery+peer: add logs to reveal shutdown flow 2022-12-08 17:57:01 +08:00
reliable_sender_test.go multi: extend lnpeer.Peer interface with Disconnect function 2024-08-27 14:11:06 -04:00
sync_manager.go multi: add debug logs for edge policy flow 2025-01-17 00:17:23 +08:00
sync_manager_test.go discovery: fix mocked peer in unit tests 2025-01-17 17:59:06 +08:00
syncer.go discovery: fix state transition in GossipSyncer 2025-03-10 16:58:16 +08:00
syncer_test.go discovery: fix state transition in GossipSyncer 2025-03-10 16:58:16 +08:00
validation_barrier.go graph -> discovery: move ValidationBarrier to discovery 2025-01-23 13:04:39 -05:00
validation_barrier_test.go graph -> discovery: move ValidationBarrier to discovery 2025-01-23 13:04:39 -05:00