discovery: queue active syncers until initial historical sync signal

In this commit, we begin to queue any active syncers until the initial
historical sync has completed. We do this to ensure we can properly
handle any new channel updates at tip. This is required for fresh nodes
that are syncing the channel graph for the first time. If we begin
accepting updates at tip while the initial historical sync is still
ongoing, then we risk not processing certain updates since we've yet to
learn of the channels themselves.
This commit is contained in:
Wilmer Paulino
2019-04-10 19:27:12 -07:00
parent 07136a5bc2
commit d68842ee9e
3 changed files with 110 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package discovery
import (
"errors"
"net"
"sync"
@@ -30,6 +31,7 @@ func (p *mockPeer) SendMessage(_ bool, msgs ...lnwire.Message) error {
select {
case p.sentMsgs <- msg:
case <-p.quit:
return errors.New("peer disconnected")
}
}