Skip to content

eth/handler_eth.go — Version Comparison

v1.16.8 v1.17.3
Branch etc/v1.16.8-full-node etc/v1.17.3-full-node
Delta +8 -0 +8 -0
ETC delta on v1.16.8 (+8 -0)
diff --git a/eth/handler_eth.go b/eth/handler_eth.go
index 11742b14a..9b53b05b3 100644
--- a/eth/handler_eth.go
+++ b/eth/handler_eth.go
@@ -57,6 +57,14 @@ func (h *ethHandler) AcceptTxs() bool {
 func (h *ethHandler) Handle(peer *eth.Peer, packet eth.Packet) error {
    // Consume any broadcasts and announces, forwarding the rest to the downloader
    switch packet := packet.(type) {
+   // PoW block announcements and broadcasts (only arrive here if peer.powExt != nil)
+   case *eth.NewBlockHashesPacket:
+       hashes, numbers := packet.Unpack()
+       return h.handleBlockAnnounces(peer, hashes, numbers)
+
+   case *eth.NewBlockPacket:
+       return h.handleBlockBroadcast(peer, packet.Block, packet.TD)
+
    case *eth.NewPooledTransactionHashesPacket:
        return h.txFetcher.Notify(peer.ID(), packet.Types, packet.Sizes, packet.Hashes)
ETC delta on v1.17.3 (+8 -0)
diff --git a/eth/handler_eth.go b/eth/handler_eth.go
index 8704a86af..0e90bfec4 100644
--- a/eth/handler_eth.go
+++ b/eth/handler_eth.go
@@ -58,6 +58,14 @@ func (h *ethHandler) AcceptTxs() bool {
 func (h *ethHandler) Handle(peer *eth.Peer, packet eth.Packet) error {
    // Consume any broadcasts and announces, forwarding the rest to the downloader
    switch packet := packet.(type) {
+   // PoW block announcements and broadcasts (only arrive here if peer.powExt != nil)
+   case *eth.NewBlockHashesPacket:
+       hashes, numbers := packet.Unpack()
+       return h.handleBlockAnnounces(peer, hashes, numbers)
+
+   case *eth.NewBlockPacket:
+       return h.handleBlockBroadcast(peer, packet.Block, packet.TD)
+
    case *eth.NewPooledTransactionHashesPacket:
        return h.txFetcher.Notify(peer.ID(), packet.Types, packet.Sizes, packet.Hashes)

← Back to Version Comparison