discovery: adhere to proper channel chunk splitting for ReplyChannelRange

This commit is contained in:
Wilmer Paulino committed 2020-12-08 15:18:07 -08:00
1 parent c5fc7334a4
commit a4f33ae63c
7 files changed
+340 -145

No files matched your search

+7 -2
View File
@@ -11,6 +11,7 @@ import (
"github.com/lightningnetwork/lnd/lntest/wait"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/ticker"
"github.com/stretchr/testify/require"
)
// randPeer creates a random peer.
@@ -537,10 +538,14 @@ func assertTransitionToChansSynced(t *testing.T, s *GossipSyncer, peer *mockPeer
}
assertMsgSent(t, peer, query)
s.ProcessQueryMsg(&lnwire.ReplyChannelRange{
require.Eventually(t, func() bool {
return s.syncState() == waitingQueryRangeReply
}, time.Second, 500*time.Millisecond)
require.NoError(t, s.ProcessQueryMsg(&lnwire.ReplyChannelRange{
QueryChannelRange: *query,
Complete: 1,
}, nil)
}, nil))
chanSeries := s.cfg.channelSeries.(*mockChannelGraphTimeSeries)