mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
whisper: update code to address Vlad's command
This commit is contained in:
parent
95d4f6f833
commit
2205d77508
1 changed files with 21 additions and 25 deletions
|
|
@ -201,35 +201,31 @@ func initialize() {
|
||||||
if len(*argIP) == 0 {
|
if len(*argIP) == 0 {
|
||||||
argIP = scanLineA("Please enter your IP and port (e.g. 127.0.0.1:30348): ")
|
argIP = scanLineA("Please enter your IP and port (e.g. 127.0.0.1:30348): ")
|
||||||
}
|
}
|
||||||
} else {
|
} else if *argPort == 0 {
|
||||||
if *argPort == 0 {
|
for {
|
||||||
for {
|
fmt.Print("Please enter the port to use: ")
|
||||||
fmt.Print("Please enter the port to use: ")
|
if _, err := fmt.Scanf("%d", argPort); err != nil || *argPort >= 1024 {
|
||||||
if _, err := fmt.Scanf("%d", argPort); err != nil || *argPort >= 1024 {
|
break
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if *useLibP2P {
|
||||||
if *useLibP2P {
|
var libp2pbootstrap *string
|
||||||
var libp2pbootstrap *string
|
for libp2pbootstrap == nil {
|
||||||
for libp2pbootstrap == nil {
|
libp2pbootstrap = scanLineA("Please enter the bootstrap node's address: ")
|
||||||
libp2pbootstrap = scanLineA("Please enter the bootstrap node's address: ")
|
|
||||||
}
|
|
||||||
libp2pbootaddr, err := multiaddr.NewMultiaddr(*libp2pbootstrap)
|
|
||||||
if err != nil {
|
|
||||||
utils.Fatalf("Error parsing the bootnode addr: %v", err)
|
|
||||||
}
|
|
||||||
fmt.Println("bootstrap addr: ", libp2pbootaddr)
|
|
||||||
libp2pPeers = append(libp2pPeers, libp2pbootaddr)
|
|
||||||
} else {
|
|
||||||
if len(*argEnode) == 0 {
|
|
||||||
argEnode = scanLineA("Please enter the peer's enode: ")
|
|
||||||
}
|
|
||||||
peer := discover.MustParseNode(*argEnode)
|
|
||||||
peers = append(peers, peer)
|
|
||||||
}
|
}
|
||||||
|
libp2pbootaddr, err := multiaddr.NewMultiaddr(*libp2pbootstrap)
|
||||||
|
if err != nil {
|
||||||
|
utils.Fatalf("Error parsing the bootnode addr: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("bootstrap addr: ", libp2pbootaddr)
|
||||||
|
libp2pPeers = append(libp2pPeers, libp2pbootaddr)
|
||||||
|
} else {
|
||||||
|
if len(*argEnode) == 0 {
|
||||||
|
argEnode = scanLineA("Please enter the peer's enode: ")
|
||||||
|
}
|
||||||
|
peer := discover.MustParseNode(*argEnode)
|
||||||
|
peers = append(peers, peer)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *mailServerMode {
|
if *mailServerMode {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue