Skip to content

queueWithHeaders.RetrieveHeaders

Source (upstream pre-purge) Current
File eth/downloader/queue.go queue_pow.go
Symbol queue.RetrieveHeaders queueWithHeaders.RetrieveHeaders
Ref 45baf2111~1 etc/v1.17.3-full-node

3-way merge — purge → getc ← upstream

pre-purge≈ adapted (origin inferred by similarity)fork-only
// RetrieveHeaders retrieves the header chain assemble based on the scheduled
// skeleton.
func (q *queueWithHeaders) RetrieveHeaders() ([]*types.Header, []common.Hash, int) {
q.queue.lock.Lock()
defer q.queue.lock.Unlock()
headers, hashes, proced := q.headerResults, q.headerHashes, q.headerProced
q.headerResults, q.headerHashes, q.headerProced = nil, nil, 0
return headers, hashes, proced
}
core-geth validation — +3 -3 | | | |---|---| | File | [`queue.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/downloader/queue.go) | | Symbol | `queue.RetrieveHeaders` | | Ref | `v1.12.20` |
--- a/core-geth/eth/downloader/queue.go
+++ b/etc/eth/downloader/queue_pow.go
@@ -1,8 +1,8 @@
 // RetrieveHeaders retrieves the header chain assemble based on the scheduled
 // skeleton.
-func (q *queue) RetrieveHeaders() ([]*types.Header, []common.Hash, int) {
-   q.lock.Lock()
-   defer q.lock.Unlock()
+func (q *queueWithHeaders) RetrieveHeaders() ([]*types.Header, []common.Hash, int) {
+   q.queue.lock.Lock()
+   defer q.queue.lock.Unlock()

    headers, hashes, proced := q.headerResults, q.headerHashes, q.headerProced
    q.headerResults, q.headerHashes, q.headerProced = nil, nil, 0

← Sync & Downloader