mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
Reverse relaxation of header downloader (#4064)
* Undo headers relaxation change * Undo headers relaxation change Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
parent
f590bf682f
commit
7c2a7150bb
@ -241,8 +241,8 @@ func (hd *HeaderDownload) MarkPreverified(link *Link) {
|
||||
if !link.persisted {
|
||||
link.verified = true
|
||||
hd.moveLinkToQueue(link, InsertQueueID)
|
||||
link = hd.links[link.header.ParentHash]
|
||||
}
|
||||
link = hd.links[link.header.ParentHash]
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,11 +275,13 @@ func (hd *HeaderDownload) extendUp(segment ChainSegment, attachmentLink *Link) {
|
||||
prevLink := attachmentLink
|
||||
for i := len(segment) - 1; i >= 0; i-- {
|
||||
link := hd.addHeaderAsLink(segment[i], false /* persisted */)
|
||||
// If we are attching to already persisted link, schedule for insertion (persistence)
|
||||
if link.verified {
|
||||
hd.moveLinkToQueue(link, InsertQueueID)
|
||||
} else {
|
||||
hd.moveLinkToQueue(link, VerifyQueueID)
|
||||
if prevLink.persisted {
|
||||
// If we are attching to already persisted link, schedule for insertion (persistence)
|
||||
if link.verified {
|
||||
hd.moveLinkToQueue(link, InsertQueueID)
|
||||
} else {
|
||||
hd.moveLinkToQueue(link, VerifyQueueID)
|
||||
}
|
||||
}
|
||||
prevLink.next = append(prevLink.next, link)
|
||||
prevLink = link
|
||||
@ -363,10 +365,12 @@ func (hd *HeaderDownload) connect(segment ChainSegment, attachmentLink *Link, an
|
||||
for i := len(segment) - 1; i >= 0; i-- {
|
||||
link := hd.addHeaderAsLink(segment[i], false /* persisted */)
|
||||
// If we attach to already persisted link, mark this one for insertion
|
||||
if link.verified {
|
||||
hd.moveLinkToQueue(link, InsertQueueID)
|
||||
} else {
|
||||
hd.moveLinkToQueue(link, VerifyQueueID)
|
||||
if prevLink.persisted {
|
||||
if link.verified {
|
||||
hd.moveLinkToQueue(link, InsertQueueID)
|
||||
} else {
|
||||
hd.moveLinkToQueue(link, VerifyQueueID)
|
||||
}
|
||||
}
|
||||
prevLink.next = append(prevLink.next, link)
|
||||
prevLink = link
|
||||
|
Loading…
Reference in New Issue
Block a user