ethHandler.handleBlockAnnounces¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | eth/handler_eth.go |
handler_pow.go |
| Symbol | ethHandler.handleBlockAnnounces |
ethHandler.handleBlockAnnounces |
| Ref | f4d53133f~1 |
etc/v1.17.3-full-node |
Removed PoS merger check (not applicable to ETC).
3-way merge — purge → getc ← upstream¶
pre-purge
↗// handleBlockAnnounces is invoked from a peer's message handler when it transmits a
// batch of block announcements for the local node to process.
func (h *ethHandler) handleBlockAnnounces(peer *eth.Peer, hashes []common.Hash, numbers []uint64) error {
↗ // Schedule all the unknown hashes for retrieval
var (
unknownHashes = make([]common.Hash, 0, len(hashes))
unknownNumbers = make([]uint64, 0, len(numbers))
)
for i := 0; i < len(hashes); i++ {
if !h.chain.HasBlock(hashes[i], numbers[i]) {
unknownHashes = append(unknownHashes, hashes[i])
unknownNumbers = append(unknownNumbers, numbers[i])
}
}
for i := 0; i < len(unknownHashes); i++ {
h.blockFetcher.Notify(peer.ID(), unknownHashes[i], unknownNumbers[i], time.Now(), peer.RequestOneHeader, peer.RequestBodies)
}
return nil
}
core-geth validation — +0 -6
| | | |---|---| | File | [`handler_eth.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/eth/handler_eth.go) | | Symbol | `ethHandler.handleBlockAnnounces` | | Ref | `v1.12.20` |--- a/core-geth/eth/handler_eth.go
+++ b/etc/eth/handler_pow.go
@@ -1,12 +1,6 @@
// handleBlockAnnounces is invoked from a peer's message handler when it transmits a
// batch of block announcements for the local node to process.
func (h *ethHandler) handleBlockAnnounces(peer *eth.Peer, hashes []common.Hash, numbers []uint64) error {
- // Drop all incoming block announces from the p2p network if
- // the chain already entered the pos stage and disconnect the
- // remote peer.
- if h.merger.PoSFinalized() {
- return errors.New("disallowed block announcement")
- }
// Schedule all the unknown hashes for retrieval
var (
unknownHashes = make([]common.Hash, 0, len(hashes))