From 2817d1d6dc3d98cbff54431705e06cf36923474c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 11 Feb 2016 23:21:14 +0100 Subject: [PATCH] p2p: send EIP-8 auth when RLPX_EIP8 is set in env --- p2p/rlpx.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/p2p/rlpx.go b/p2p/rlpx.go index c13fde96d1..469390c0c9 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -31,6 +31,7 @@ import ( "io" mrand "math/rand" "net" + "os" "sync" "time" @@ -271,7 +272,12 @@ func initiatorEncHandshake(conn io.ReadWriter, prv *ecdsa.PrivateKey, remoteID d if err != nil { return s, err } - authPacket, err := authMsg.sealPlain(h) + var authPacket []byte + if os.Getenv("RLPX_EIP8") != "" { + authPacket, err = sealEIP8(authMsg, h) + } else { + authPacket, err = authMsg.sealPlain(h) + } if err != nil { return s, err }