Skip to content

BlockFetcher.FilterBodies

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

3-way merge — purge → getc ← upstream

pre-purge
// FilterBodies extracts all the block bodies that were explicitly requested by
// the fetcher, returning those that should be handled differently.
func (f *BlockFetcher) FilterBodies(peer string, transactions [][]*types.Transaction, uncles [][]*types.Header, time time.Time) ([][]*types.Transaction, [][]*types.Header) {
log.Trace("Filtering bodies", "peer", peer, "txs", len(transactions), "uncles", len(uncles))
// Send the filter channel to the fetcher
filter := make(chan *bodyFilterTask)
select {
case f.bodyFilter <- filter:
case <-f.quit:
return nil, nil
}
// Request the filtering of the body list
select {
case filter <- &bodyFilterTask{peer: peer, transactions: transactions, uncles: uncles, time: time}:
case <-f.quit:
return nil, nil
}
// Retrieve the bodies remaining after filtering
select {
case task := <-filter:
return task.transactions, task.uncles
case <-f.quit:
return nil, nil
}
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`block_fetcher.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/fetcher/block_fetcher.go) | | Symbol | `BlockFetcher.FilterBodies` | | Ref | `v1.12.20` |

← Sync & Downloader