diff options
author | Felix Lange <fjl@twurst.com> | 2016-05-18 17:31:00 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-05-18 18:19:04 +0800 |
commit | 542b839ec74ff0ce94ab0d34e25531f5819d95d1 (patch) | |
tree | 75fa706a695285a134efc5d3c7ed4a5f497e04b3 /p2p/server.go | |
parent | c8a8ad97f7e8889ca9f3aece7ddb50cce8ef18c7 (diff) | |
download | dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.gz dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.bz2 dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.lz dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.xz dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.zst dexon-542b839ec74ff0ce94ab0d34e25531f5819d95d1.zip |
node, p2p: move network config out of Server
This silences a go vet message about copying p2p.Server in package node.
Diffstat (limited to 'p2p/server.go')
-rw-r--r-- | p2p/server.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/p2p/server.go b/p2p/server.go index 3b2f2b078..880aa7cf1 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -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. |