Reduce persistent link kept (#1969)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
ledgerwatch 2021-05-20 07:57:17 +01:00 committed by GitHub
parent ba29249f07
commit 4b897d679f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,11 +200,12 @@ func NewHeaderDownload(
linkLimit int,
engine consensus.Engine,
) *HeaderDownload {
persistentLinkLimit := linkLimit / 16
hd := &HeaderDownload{
badHeaders: make(map[common.Hash]struct{}),
anchors: make(map[common.Hash]*Anchor),
persistedLinkLimit: linkLimit / 2,
linkLimit: linkLimit / 2,
persistedLinkLimit: persistentLinkLimit,
linkLimit: linkLimit - persistentLinkLimit,
anchorLimit: anchorLimit,
engine: engine,
preverifiedHashes: make(map[common.Hash]struct{}),