aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-03 03:21:57 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-03 03:21:57 +0800
commite7b33e9ae796cd0ba4c840ee3fead85132ebdccd (patch)
treea833d9f66d175173fe57520b2b08ce45afbae86a
parentfb2488235a9cc187047810817ce3fa34c5087c67 (diff)
downloadgo-tangerine-e7b33e9ae796cd0ba4c840ee3fead85132ebdccd.tar.gz
go-tangerine-e7b33e9ae796cd0ba4c840ee3fead85132ebdccd.tar.zst
go-tangerine-e7b33e9ae796cd0ba4c840ee3fead85132ebdccd.zip
Move p2p.MakeName to ethutil.MakeVersion
-rw-r--r--cmd/ethereum/main.go3
-rw-r--r--cmd/mist/main.go4
-rw-r--r--ethutil/common.go4
-rw-r--r--p2p/server.go10
4 files changed, 8 insertions, 13 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index f79f948d1..afb90d72a 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -31,7 +31,6 @@ import (
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state"
)
@@ -62,7 +61,7 @@ func main() {
utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
ethereum, err := eth.New(&eth.Config{
- Name: p2p.MakeName(ClientIdentifier, Version),
+ Name: ethutil.MakeVersion(ClientIdentifier, Version),
KeyStore: KeyStore,
DataDir: Datadir,
LogFile: LogFile,
diff --git a/cmd/mist/main.go b/cmd/mist/main.go
index c9a07bfde..0ece20d2c 100644
--- a/cmd/mist/main.go
+++ b/cmd/mist/main.go
@@ -28,8 +28,8 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth"
+ "github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/ui/qt/webengine"
"github.com/obscuren/qml"
)
@@ -52,7 +52,7 @@ func run() error {
config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
ethereum, err := eth.New(&eth.Config{
- Name: p2p.MakeName(ClientIdentifier, Version),
+ Name: ethutil.MakeVersion(ClientIdentifier, Version),
KeyStore: KeyStore,
DataDir: Datadir,
LogFile: LogFile,
diff --git a/ethutil/common.go b/ethutil/common.go
index 9b66763b8..88f4cd189 100644
--- a/ethutil/common.go
+++ b/ethutil/common.go
@@ -13,6 +13,10 @@ import (
"github.com/kardianos/osext"
)
+func MakeVersion(name, version string) string {
+ return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version())
+}
+
func DefaultAssetPath() string {
var assetPath string
pwd, _ := os.Getwd()
diff --git a/p2p/server.go b/p2p/server.go
index 3ea2538d1..25da04cd9 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"net"
- "runtime"
"sync"
"time"
@@ -24,13 +23,6 @@ const (
var srvlog = logger.NewLogger("P2P Server")
var srvjslog = logger.NewJsonLogger()
-// MakeName creates a node name that follows the ethereum convention
-// for such names. It adds the operation system name and Go runtime version
-// the name.
-func MakeName(name, version string) string {
- return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version())
-}
-
// Server manages all peer connections.
//
// The fields of Server are used as configuration parameters.
@@ -45,7 +37,7 @@ type Server struct {
MaxPeers int
// Name sets the node name of this server.
- // Use MakeName to create a name that follows existing conventions.
+ // Use ethutil.MakeVersion to create a name that follows existing conventions.
Name string
// Bootstrap nodes are used to establish connectivity