From 790cde028bf9768db74d8079cddd4caeebf655ce Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 12 Jan 2016 16:04:34 -0800 Subject: [PATCH] Remove NewNodeDefault... --- node/node.go | 14 +++++--------- node/node_test.go | 7 ++++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/node/node.go b/node/node.go index d3760e042..077e11d3e 100644 --- a/node/node.go +++ b/node/node.go @@ -41,14 +41,6 @@ type Node struct { privKey crypto.PrivKeyEd25519 } -func NewNodeDefaultPrivVal() *Node { - // Get PrivValidator - privValidatorFile := config.GetString("priv_validator_file") - privValidator := types.LoadOrGenPrivValidator(privValidatorFile) - - return NewNode(privValidator) -} - func NewNode(privValidator *types.PrivValidator) *Node { // Get BlockStore blockStoreDB := dbm.GetDB("blockstore") @@ -280,8 +272,12 @@ func RunNode() { } } + // Get PrivValidator + privValidatorFile := config.GetString("priv_validator_file") + privValidator := types.LoadOrGenPrivValidator(privValidatorFile) + // Create & start node - n := NewNodeDefaultPrivVal() + n := NewNode(privValidator) l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), config.GetBool("skip_upnp")) n.AddListener(l) err := n.Start() diff --git a/node/node_test.go b/node/node_test.go index e0898a979..d171bdc17 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -7,6 +7,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-p2p" _ "github.com/tendermint/tendermint/config/tendermint_test" + "github.com/tendermint/tendermint/types" "github.com/tendermint/tmsp/example/golang" "github.com/tendermint/tmsp/server" ) @@ -23,8 +24,12 @@ func TestNodeStartStop(t *testing.T) { // wait for the server time.Sleep(time.Second * 2) + // Get PrivValidator + privValidatorFile := config.GetString("priv_validator_file") + privValidator := types.LoadOrGenPrivValidator(privValidatorFile) + // Create & start node - n := NewNodeDefaultPrivVal() + n := NewNode(privValidator) l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), config.GetBool("skip_upnp")) n.AddListener(l) n.Start()