diff --git a/discovery/sync_manager_test.go b/discovery/sync_manager_test.go index f71d1728e..f4e35bddd 100644 --- a/discovery/sync_manager_test.go +++ b/discovery/sync_manager_test.go @@ -28,7 +28,7 @@ func randPeer(t *testing.T, quit chan struct{}) *mockPeer { func peerWithPubkey(pk *btcec.PublicKey, quit chan struct{}) *mockPeer { return &mockPeer{ pk: pk, - sentMsgs: make(chan lnwire.Message), + sentMsgs: make(chan lnwire.Message, 1), quit: quit, } } @@ -483,7 +483,9 @@ func TestSyncManagerWaitUntilInitialHistoricalSync(t *testing.T) { // transition it to chansSynced to ensure the remaining syncers // aren't started as active. if i == 0 { - assertSyncerStatus(t, s, syncingChans, PassiveSync) + assertSyncerStatus( + t, s, waitingQueryRangeReply, PassiveSync, + ) continue } diff --git a/discovery/syncer.go b/discovery/syncer.go index 79794271a..f0ce4ffcb 100644 --- a/discovery/syncer.go +++ b/discovery/syncer.go @@ -495,6 +495,8 @@ func (g *GossipSyncer) handleSyncingChans() { g.Lock() defer g.Unlock() + // Send the msg to the remote peer, which is non-blocking as + // `sendToPeer` only queues the msg in Brontide. err = g.cfg.sendToPeer(queryRangeMsg) if err != nil { log.Errorf("Unable to send chan range query: %v", err)