Skip to content

Commit 3a2da31

Browse files
committed
Merge pull request bnb-chain#2412 from fjl/p2p-eip8-enable
p2p: enable EIP-8 handshake sending
2 parents 52dc7cb + 659c0cb commit 3a2da31

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎p2p/rlpx.go‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"io"
3232
mrand "math/rand"
3333
"net"
34-
"os"
3534
"sync"
3635
"time"
3736

@@ -262,8 +261,6 @@ func (h *encHandshake) staticSharedSecret(prv *ecdsa.PrivateKey) ([]byte, error)
262261
return ecies.ImportECDSA(prv).GenerateShared(h.remotePub, sskLen, sskLen)
263262
}
264263

265-
var configSendEIP = os.Getenv("RLPX_EIP8") != ""
266-
267264
// initiatorEncHandshake negotiates a session token on conn.
268265
// it should be called on the dialing side of the connection.
269266
//
@@ -274,12 +271,7 @@ func initiatorEncHandshake(conn io.ReadWriter, prv *ecdsa.PrivateKey, remoteID d
274271
if err != nil {
275272
return s, err
276273
}
277-
var authPacket []byte
278-
if configSendEIP {
279-
authPacket, err = sealEIP8(authMsg, h)
280-
} else {
281-
authPacket, err = authMsg.sealPlain(h)
282-
}
274+
authPacket, err := sealEIP8(authMsg, h)
283275
if err != nil {
284276
return s, err
285277
}

0 commit comments

Comments
 (0)