Disabled ability to disable whisper. Closes #334

This commit is contained in:
obscuren 2015-02-18 11:42:01 +01:00
parent 60318c96d0
commit 05b1ec008b
4 changed files with 8 additions and 3 deletions

View File

@ -132,7 +132,7 @@ func Init() {
natstr = flag.String("nat", "any", "port mapping mechanism (any|none|upnp|pmp|extip:<IP>)") natstr = flag.String("nat", "any", "port mapping mechanism (any|none|upnp|pmp|extip:<IP>)")
) )
flag.BoolVar(&Dial, "dial", true, "dial out connections (default on)") flag.BoolVar(&Dial, "dial", true, "dial out connections (default on)")
flag.BoolVar(&SHH, "shh", true, "run whisper protocol (default on)") //flag.BoolVar(&SHH, "shh", true, "run whisper protocol (default on)")
flag.StringVar(&OutboundPort, "port", "30303", "listening port") flag.StringVar(&OutboundPort, "port", "30303", "listening port")
flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap") flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap")

View File

@ -71,7 +71,7 @@ func main() {
Port: OutboundPort, Port: OutboundPort,
NAT: NAT, NAT: NAT,
KeyRing: KeyRing, KeyRing: KeyRing,
Shh: SHH, Shh: true,
Dial: Dial, Dial: Dial,
BootNodes: BootNodes, BootNodes: BootNodes,
NodeKey: NodeKey, NodeKey: NodeKey,

View File

@ -60,6 +60,7 @@ func run() error {
MaxPeers: MaxPeer, MaxPeers: MaxPeer,
Port: OutboundPort, Port: OutboundPort,
NAT: NAT, NAT: NAT,
Shh: true,
BootNodes: BootNodes, BootNodes: BootNodes,
NodeKey: NodeKey, NodeKey: NodeKey,
KeyRing: KeyRing, KeyRing: KeyRing,

View File

@ -160,7 +160,11 @@ func New(config *Config) (*Ethereum, error) {
eth.blockPool = NewBlockPool(hasBlock, insertChain, ezp.Verify) eth.blockPool = NewBlockPool(hasBlock, insertChain, ezp.Verify)
ethProto := EthProtocol(eth.txPool, eth.chainManager, eth.blockPool) ethProto := EthProtocol(eth.txPool, eth.chainManager, eth.blockPool)
protocols := []p2p.Protocol{ethProto, eth.whisper.Protocol()} protocols := []p2p.Protocol{ethProto}
if config.Shh {
protocols = append(protocols, eth.whisper.Protocol())
}
netprv := config.NodeKey netprv := config.NodeKey
if netprv == nil { if netprv == nil {
if netprv, err = crypto.GenerateKey(); err != nil { if netprv, err = crypto.GenerateKey(); err != nil {