Skip to content

BlockFetcher.Notify

Source (upstream pre-purge) Current
File eth/fetcher/block_fetcher.go block_fetcher_pow.go
Symbol BlockFetcher.Notify BlockFetcher.Notify
Ref f4d53133f~1 etc/v1.17.3-full-node

Renamed from errTerminated (collides with var in tx_fetcher.go, same package) — see errTerminatedBlockFetcher

3-way merge — purge → getc ← upstream

pre-purgefork-only
// Notify announces the fetcher of the potential availability of a new block in
// the network.
func (f *BlockFetcher) Notify(peer string, hash common.Hash, number uint64, time time.Time,
headerFetcher headerRequesterFn, bodyFetcher bodyRequesterFn) error {
block := &blockAnnounce{
hash: hash,
number: number,
time: time,
origin: peer,
fetchHeader: headerFetcher,
fetchBodies: bodyFetcher,
}
select {
case f.notify <- block:
return nil
case <-f.quit:
return errTerminatedBlockFetcher
}
}
core-geth validation — +1 -1 | | | |---|---| | File | [`block_fetcher.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/fetcher/block_fetcher.go) | | Symbol | `BlockFetcher.Notify` | | Ref | `v1.12.20` |
--- a/core-geth/eth/fetcher/block_fetcher.go
+++ b/etc/eth/fetcher/block_fetcher_pow.go
@@ -14,6 +14,6 @@
    case f.notify <- block:
        return nil
    case <-f.quit:
-       return errTerminated
+       return errTerminatedBlockFetcher
    }
 }

← Sync & Downloader