Przeglądaj źródła

Merge pull request #2412 from fjl/p2p-eip8-enable

p2p: enable EIP-8 handshake sending
Péter Szilágyi 9 lat temu
rodzic
commit
3a2da31c3e
1 zmienionych plików z 1 dodań i 9 usunięć
  1. 1 9
      p2p/rlpx.go

+ 1 - 9
p2p/rlpx.go

@@ -31,7 +31,6 @@ import (
 	"io"
 	mrand "math/rand"
 	"net"
-	"os"
 	"sync"
 	"time"
 
@@ -262,8 +261,6 @@ func (h *encHandshake) staticSharedSecret(prv *ecdsa.PrivateKey) ([]byte, error)
 	return ecies.ImportECDSA(prv).GenerateShared(h.remotePub, sskLen, sskLen)
 }
 
-var configSendEIP = os.Getenv("RLPX_EIP8") != ""
-
 // initiatorEncHandshake negotiates a session token on conn.
 // it should be called on the dialing side of the connection.
 //
@@ -274,12 +271,7 @@ func initiatorEncHandshake(conn io.ReadWriter, prv *ecdsa.PrivateKey, remoteID d
 	if err != nil {
 		return s, err
 	}
-	var authPacket []byte
-	if configSendEIP {
-		authPacket, err = sealEIP8(authMsg, h)
-	} else {
-		authPacket, err = authMsg.sealPlain(h)
-	}
+	authPacket, err := sealEIP8(authMsg, h)
 	if err != nil {
 		return s, err
 	}