From d0a2e655c9599f462bb20bd49bc69b8e1e330a21 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 11 Feb 2015 17:19:31 +0100 Subject: cmd/ethereum, cmd/mist, eth, p2p: use package p2p/nat This deletes the old NAT implementation. --- eth/backend.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'eth/backend.go') diff --git a/eth/backend.go b/eth/backend.go index f3e4842a7..29cf7d836 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -13,6 +13,7 @@ import ( ethlogger "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/pow/ezp" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/whisper" @@ -28,10 +29,8 @@ type Config struct { LogLevel int KeyRing string - MaxPeers int - Port string - NATType string - PMPGateway string + MaxPeers int + Port string // This should be a space-separated list of // discovery node URLs. @@ -41,6 +40,7 @@ type Config struct { // If nil, an ephemeral key is used. NodeKey *ecdsa.PrivateKey + NAT nat.Interface Shh bool Dial bool @@ -147,10 +147,6 @@ func New(config *Config) (*Ethereum, error) { ethProto := EthProtocol(eth.txPool, eth.chainManager, eth.blockPool) protocols := []p2p.Protocol{ethProto, eth.whisper.Protocol()} - nat, err := p2p.ParseNAT(config.NATType, config.PMPGateway) - if err != nil { - return nil, err - } netprv := config.NodeKey if netprv == nil { if netprv, err = crypto.GenerateKey(); err != nil { @@ -163,7 +159,7 @@ func New(config *Config) (*Ethereum, error) { MaxPeers: config.MaxPeers, Protocols: protocols, Blacklist: eth.blacklist, - NAT: nat, + NAT: config.NAT, NoDial: !config.Dial, BootstrapNodes: config.parseBootNodes(), } -- cgit