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
↗ }
}