mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-18 13:52:02 +01:00
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.