remember syncer windowSize

This commit is contained in:
vyzo 2020-08-28 22:52:40 +03:00
parent 4e7fd5b6d7
commit 3935fd77ac

View File

@ -123,6 +123,8 @@ type Syncer struct {
receiptTracker *blockReceiptTracker
verifier ffiwrapper.Verifier
windowSize int
}
// NewSyncer creates a new Syncer object.
@ -148,6 +150,7 @@ func NewSyncer(sm *stmgr.StateManager, bsync *blocksync.BlockSync, connmgr connm
receiptTracker: newBlockReceiptTracker(),
connmgr: connmgr,
verifier: verifier,
windowSize: defaultMessageFetchWindowSize,
incoming: pubsub.New(50),
}
@ -1413,7 +1416,7 @@ func (syncer *Syncer) iterFullTipsets(ctx context.Context, headers []*types.TipS
span.AddAttributes(trace.Int64Attribute("num_headers", int64(len(headers))))
windowSize := defaultMessageFetchWindowSize
windowSize := syncer.windowSize
mainLoop:
for i := len(headers) - 1; i >= 0; {
fts, err := syncer.store.TryFillTipSet(headers[i])
@ -1490,6 +1493,9 @@ mainLoop:
}
}
// remember our window size
syncer.windowSize = windowSize
return nil
}