mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
Add comments about anchorQueue (#2382)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
parent
c0488ea919
commit
eb5402ee05
@ -223,6 +223,9 @@ func (hd *HeaderDownload) extendDown(segment *ChainSegment, start, end int) (boo
|
||||
}
|
||||
}
|
||||
|
||||
// Anchor is removed from the map, but not from the anchorQueue
|
||||
// This is because it is hard to find the index under which the anchor is stored in the anchorQueue
|
||||
// But removal will happen anyway, in th function RequestMoreHeaders, if it disapppears from the map
|
||||
delete(hd.anchors, anchor.parentHash)
|
||||
// Add all headers in the segments as links to this anchor
|
||||
var prevLink *Link
|
||||
@ -275,6 +278,9 @@ func (hd *HeaderDownload) connect(segment *ChainSegment, start, end int) error {
|
||||
break
|
||||
}
|
||||
}
|
||||
// Anchor is removed from the map, but not from the anchorQueue
|
||||
// This is because it is hard to find the index under which the anchor is stored in the anchorQueue
|
||||
// But removal will happen anyway, in th function RequestMoreHeaders, if it disapppears from the map
|
||||
delete(hd.anchors, anchor.parentHash)
|
||||
// Iterate over headers backwards (from parents towards children)
|
||||
prevLink := attachmentLink
|
||||
|
Loading…
Reference in New Issue
Block a user