forked from cerc-io/plugeth
cmd/peerserver: use NoDial, don't use seed peers
This commit is contained in:
parent
545e14691b
commit
4c8c115a76
@ -18,9 +18,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/elliptic"
|
"crypto/elliptic"
|
||||||
"fmt"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
@ -38,19 +36,10 @@ func main() {
|
|||||||
Identity: p2p.NewSimpleClientIdentity("Ethereum(G)", "0.1", "Peer Server Two", marshaled),
|
Identity: p2p.NewSimpleClientIdentity("Ethereum(G)", "0.1", "Peer Server Two", marshaled),
|
||||||
ListenAddr: ":30301",
|
ListenAddr: ":30301",
|
||||||
NAT: p2p.UPNP(),
|
NAT: p2p.UPNP(),
|
||||||
|
NoDial: true,
|
||||||
}
|
}
|
||||||
if err := srv.Start(); err != nil {
|
if err := srv.Start(); err != nil {
|
||||||
fmt.Println("could not start server:", err)
|
log.Fatal("could not start server:", err)
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add seed peers
|
|
||||||
seed, err := net.ResolveTCPAddr("tcp", "poc-8.ethdev.com:30303")
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("couldn't resolve:", err)
|
|
||||||
} else {
|
|
||||||
srv.SuggestPeer(seed.IP, seed.Port, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user