discovery/sync_manager: remove unneeded markGraphSyncing
AFAICT it's not possible to flip back from bein synced_to_chain, so we remove the underlying call that could reflect this. The method is moved into the test file since it's still used to test correctness of other portions of the flow.
This commit is contained in:
parent
e42301dee2
commit
b1fee734ec
@ -12,6 +12,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -3616,6 +3617,12 @@ func TestCalculateCorrectSubBatchSizesDifferentDelay(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// markGraphSynced allows us to report that the initial historical sync has
|
||||||
|
// completed.
|
||||||
|
func (m *SyncManager) markGraphSyncing() {
|
||||||
|
atomic.StoreInt32(&m.initialHistoricalSyncCompleted, 0)
|
||||||
|
}
|
||||||
|
|
||||||
// TestBroadcastAnnsAfterGraphSynced ensures that we only broadcast
|
// TestBroadcastAnnsAfterGraphSynced ensures that we only broadcast
|
||||||
// announcements after the graph has been considered as synced, i.e., after our
|
// announcements after the graph has been considered as synced, i.e., after our
|
||||||
// initial historical sync has completed.
|
// initial historical sync has completed.
|
||||||
|
@ -316,7 +316,6 @@ func (m *SyncManager) syncerHandler() {
|
|||||||
if !attemptHistoricalSync {
|
if !attemptHistoricalSync {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
m.markGraphSyncing()
|
|
||||||
|
|
||||||
log.Debugf("Attempting initial historical sync with "+
|
log.Debugf("Attempting initial historical sync with "+
|
||||||
"GossipSyncer(%x)", s.cfg.peerPub)
|
"GossipSyncer(%x)", s.cfg.peerPub)
|
||||||
@ -751,12 +750,6 @@ func (m *SyncManager) markGraphSynced() {
|
|||||||
atomic.StoreInt32(&m.initialHistoricalSyncCompleted, 1)
|
atomic.StoreInt32(&m.initialHistoricalSyncCompleted, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// markGraphSyncing allows us to report that the initial historical sync is
|
|
||||||
// still undergoing.
|
|
||||||
func (m *SyncManager) markGraphSyncing() {
|
|
||||||
atomic.StoreInt32(&m.initialHistoricalSyncCompleted, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsGraphSynced determines whether we've completed our initial historical sync.
|
// IsGraphSynced determines whether we've completed our initial historical sync.
|
||||||
// The initial historical sync is done to ensure we've ingested as much of the
|
// The initial historical sync is done to ensure we've ingested as much of the
|
||||||
// public graph as possible.
|
// public graph as possible.
|
||||||
|
Loading…
Reference in New Issue
Block a user