Skip to content

Peer.SendNewBlock

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

3-way merge — purge → getc ← upstream

pre-purge≈ adapted (origin inferred by similarity)
// SendNewBlock propagates an entire block to a remote peer.
func (p *Peer) SendNewBlock(block *types.Block, td *big.Int) error {
// Mark all the block hash as known, but ensure we don't overflow our limits
p.powExt.knownBlocks.Add(block.Hash())
return p2p.Send(p.rw, NewBlockMsg, &NewBlockPacket{
Block: block,
TD: td,
})
}
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.SendNewBlock` | | Ref | `v1.12.20` |
--- a/core-geth/eth/protocols/eth/peer.go
+++ b/etc/eth/protocols/eth/peer_pow.go
@@ -1,7 +1,7 @@
 // SendNewBlock propagates an entire block to a remote peer.
 func (p *Peer) SendNewBlock(block *types.Block, td *big.Int) error {
    // Mark all the block hash as known, but ensure we don't overflow our limits
-   p.knownBlocks.Add(block.Hash())
+   p.powExt.knownBlocks.Add(block.Hash())
    return p2p.Send(p.rw, NewBlockMsg, &NewBlockPacket{
        Block: block,
        TD:    td,

← eth Protocol