Skip to content

Peer.SendNewBlockHashes

Source (upstream pre-purge) Current
File eth/protocols/eth/peer.go peer_pow.go
Symbol Peer.SendNewBlockHashes Peer.SendNewBlockHashes
Ref f4d53133f~1 etc/v1.17.3-full-node

3-way merge — purge → getc ← upstream

pre-purge≈ adapted (origin inferred by similarity)
// SendNewBlockHashes announces the availability of a number of blocks through
// a hash notification.
func (p *Peer) SendNewBlockHashes(hashes []common.Hash, numbers []uint64) error {
// Mark all the block hashes as known, but ensure we don't overflow our limits
p.powExt.knownBlocks.Add(hashes...)
request := make(NewBlockHashesPacket, len(hashes))
for i := 0; i < len(hashes); i++ {
request[i].Hash = hashes[i]
request[i].Number = numbers[i]
}
return p2p.Send(p.rw, NewBlockHashesMsg, request)
}
core-geth validation — +1 -1 | | | |---|---| | File | [`peer.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/protocols/eth/peer.go) | | Symbol | `Peer.SendNewBlockHashes` | | Ref | `v1.12.20` |
--- a/core-geth/eth/protocols/eth/peer.go
+++ b/etc/eth/protocols/eth/peer_pow.go
@@ -2,7 +2,7 @@
 // a hash notification.
 func (p *Peer) SendNewBlockHashes(hashes []common.Hash, numbers []uint64) error {
    // Mark all the block hashes as known, but ensure we don't overflow our limits
-   p.knownBlocks.Add(hashes...)
+   p.powExt.knownBlocks.Add(hashes...)

    request := make(NewBlockHashesPacket, len(hashes))
    for i := 0; i < len(hashes); i++ {

← eth Protocol