Skip to content

Peer.AsyncSendNewBlock

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

3-way merge — purge → getc ← upstream

pre-purge≈ adapted (origin inferred by similarity)
// AsyncSendNewBlock queues an entire block for propagation to a remote peer. If
// the peer's broadcast queue is full, the event is silently dropped.
func (p *Peer) AsyncSendNewBlock(block *types.Block, td *big.Int) {
select {
case p.powExt.queuedBlocks <- &blockPropagation{block: block, td: td}:
// Mark all the block hash as known, but ensure we don't overflow our limits
p.powExt.knownBlocks.Add(block.Hash())
default:
p.Log().Debug("Dropping block propagation", "number", block.NumberU64(), "hash", block.Hash())
}
}
core-geth validation — +2 -2 | | | |---|---| | File | [`peer.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/protocols/eth/peer.go) | | Symbol | `Peer.AsyncSendNewBlock` | | Ref | `v1.12.20` |
--- a/core-geth/eth/protocols/eth/peer.go
+++ b/etc/eth/protocols/eth/peer_pow.go
@@ -2,9 +2,9 @@
 // the peer's broadcast queue is full, the event is silently dropped.
 func (p *Peer) AsyncSendNewBlock(block *types.Block, td *big.Int) {
    select {
-   case p.queuedBlocks <- &blockPropagation{block: block, td: td}:
+   case p.powExt.queuedBlocks <- &blockPropagation{block: block, td: td}:
        // 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())
    default:
        p.Log().Debug("Dropping block propagation", "number", block.NumberU64(), "hash", block.Hash())
    }

← eth Protocol