node, p2p: move network config out of Server

This silences a go vet message about copying p2p.Server in package node.
This commit is contained in:
Felix Lange
2016-05-18 11:31:00 +02:00
parent c8a8ad97f7
commit 542b839ec7
4 changed files with 36 additions and 28 deletions

View File

@ -54,12 +54,8 @@ var errServerStopped = errors.New("server stopped")
var srvjslog = logger.NewJsonLogger()
// Server manages all peer connections.
//
// The fields of Server are used as configuration parameters.
// You should set them before starting the Server. Fields may not be
// modified while the server is running.
type Server struct {
// Config holds Server options.
type Config struct {
// This field must be set to a valid secp256k1 private key.
PrivateKey *ecdsa.PrivateKey
@ -120,6 +116,12 @@ type Server struct {
// If NoDial is true, the server will not dial any peers.
NoDial bool
}
// Server manages all peer connections.
type Server struct {
// Config fields may not be modified while the server is running.
Config
// Hooks for testing. These are useful because we can inhibit
// the whole protocol stack.