Skip to content

eth/protocols/eth/handshake.go

Type MOD
Upstream Lines 163
Changed +12 -1

Upstream handshake: ETH68 intentionally has no case in the version switch — it's handled by Handshake68PoW from the PoW branch, so non-PoW callers never enter a TD-less ETH68 path

diff --git a/eth/protocols/eth/handshake.go b/eth/protocols/eth/handshake.go
index 359e4e36b..9af18d00c 100644
--- a/eth/protocols/eth/handshake.go
+++ b/eth/protocols/eth/handshake.go
@@ -34,8 +34,19 @@ const (
 )

 // Handshake executes the eth protocol handshake, negotiating version number,
-// network IDs, difficulties, head and genesis blocks.
+// network IDs, difficulties, head and genesis blocks. ETH68 is handled by
+// Handshake68PoW directly from the PoW handler branch; it intentionally
+// has no case here so non-PoW callers never enter a TD-less ETH68 path.
 func (p *Peer) Handshake(networkID uint64, chain forkid.Blockchain, rangeMsg BlockRangeUpdatePacket) error {
+   switch p.version {
+   case ETH70, ETH69:
+       return p.handshake69(networkID, chain, rangeMsg)
+   default:
+       return errors.New("unsupported protocol version")
+   }
+}
+
+func (p *Peer) handshake69(networkID uint64, chain forkid.Blockchain, rangeMsg BlockRangeUpdatePacket) error {
    var (
        genesis    = chain.Genesis()
        latest     = chain.CurrentHeader()

← Back to eth Protocol