diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 5e32562085..275fcf248c 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -60,6 +60,7 @@ var ( VmType int ImportChain string SHH bool + Dial bool ) // flags specific to cli client @@ -96,6 +97,7 @@ func Init() { flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)") flag.BoolVar(&UseSeed, "seed", true, "seed peers") flag.BoolVar(&SHH, "shh", true, "whisper protocol (on)") + flag.BoolVar(&Dial, "dial", true, "dial out connections (on)") flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key") flag.StringVar(&SecretFile, "import", "", "imports the file given (hex or mnemonic formats)") flag.StringVar(&ExportDir, "export", "", "exports the session keyring to files in the directory given") diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 85ed20171b..8b83bbd376 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -65,6 +65,7 @@ func main() { PMPGateway: PMPGateway, KeyRing: KeyRing, Shh: SHH, + Dial: Dial, }) if err != nil { diff --git a/eth/backend.go b/eth/backend.go index 4c24a5b1b5..72149ad2be 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -36,7 +36,8 @@ type Config struct { NATType string PMPGateway string - Shh bool + Shh bool + Dial bool KeyManager *crypto.KeyManager } @@ -150,6 +151,7 @@ func New(config *Config) (*Ethereum, error) { Protocols: protocols, Blacklist: eth.blacklist, NAT: nat, + NoDial: !config.Dial, } if len(config.Port) > 0 { diff --git a/p2p/server.go b/p2p/server.go index c6bb8c561a..7ba41cb53d 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -189,6 +189,7 @@ func (srv *Server) Start() (err error) { // make all slots available for i := range srv.peers { + srvlog.Debugf("add slot %v", i) srv.peerSlots <- i } // note: discLoop is not part of WaitGroup @@ -260,6 +261,7 @@ func (srv *Server) listenLoop() { for { select { case slot := <-srv.peerSlots: + srvlog.Debugf("grabbed slot %v for listening", slot) conn, err := srv.listener.Accept() if err != nil { srv.peerSlots <- slot