From f34cef1d47bb3e31da3f9a8cdee9fdec78407613 Mon Sep 17 00:00:00 2001 From: Daniel Whitenack Date: Fri, 1 Jul 2016 10:43:55 -0500 Subject: [PATCH] account sync pointer fix --- src/gethdep.go | 4 ++-- src/main.go | 18 +++++++++--------- .../ethereum/go-ethereum/cmd/utils/flags.go | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gethdep.go b/src/gethdep.go index 7e25a2774..4242d67f7 100644 --- a/src/gethdep.go +++ b/src/gethdep.go @@ -25,7 +25,7 @@ func createAccount(password string) (string, string, error) { w := true keydir := datadir + "/keystore" - accman := accounts.NewManager(keydir, scryptN, scryptP, &accountSync) + accman := accounts.NewManager(keydir, scryptN, scryptP, accountSync) // generate the account account, err := accman.NewAccount(password, w) @@ -60,7 +60,7 @@ func unlockAccount(address, password string, seconds int) error { if currentNode != nil { - accman := utils.MakeAccountManager(c, &accountSync) + accman := utils.MakeAccountManager(c, accountSync) account, err := utils.MakeAddress(accman, address) if err != nil { return errextra.Wrap(err, "Could not retrieve account from address") diff --git a/src/main.go b/src/main.go index 26c9bb95e..839e6d721 100644 --- a/src/main.go +++ b/src/main.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "runtime" + "time" "github.com/codegangsta/cli" "github.com/ethereum/go-ethereum/cmd/utils" @@ -27,12 +28,12 @@ const ( ) var ( - vString string // Combined textual representation of the version - rConfig release.Config // Structured version information and release oracle config - currentNode *node.Node // currently running geth node - c *cli.Context // the CLI context used to start the geth node - accountSync []node.Service // the object used to sync accounts between geth services - datadir string // data directory for geth + vString string // Combined textual representation of the version + rConfig release.Config // Structured version information and release oracle config + currentNode *node.Node // currently running geth node + c *cli.Context // the CLI context used to start the geth node + accountSync *[]node.Service // the object used to sync accounts between geth services + datadir string // data directory for geth ) func main() { @@ -40,8 +41,6 @@ func main() { // Placeholder for anything we want to run by default fmt.Println("You are running statusgo!") - createAndStartNode(".ethereum") - } // MakeNode create a geth node entity @@ -58,7 +57,7 @@ func MakeNode(inputDir string) *node.Node { set.String("rpcport", "8545", "rpc port") set.String("rpcapi", "db,eth,net,web3,shh,admin", "rpc api(s)") set.String("datadir", datadir, "data directory for geth") - set.String("logdir", datadir, "log dir for glog") + //set.String("logdir", datadir, "log dir for glog") c = cli.NewContext(nil, set, nil) // Construct the textual version string from the individual components @@ -73,6 +72,7 @@ func MakeNode(inputDir string) *node.Node { utils.DebugSetup(c) currentNode, accountSync = utils.MakeSystemNode(clientIdentifier, vString, rConfig, makeDefaultExtra(), c) + fmt.Println(accountSync) return currentNode } diff --git a/src/vendor/github.com/ethereum/go-ethereum/cmd/utils/flags.go b/src/vendor/github.com/ethereum/go-ethereum/cmd/utils/flags.go index c4d90dc79..624b8c209 100644 --- a/src/vendor/github.com/ethereum/go-ethereum/cmd/utils/flags.go +++ b/src/vendor/github.com/ethereum/go-ethereum/cmd/utils/flags.go @@ -670,7 +670,7 @@ func MakePasswordList(ctx *cli.Context) []string { // MakeSystemNode sets up a local node, configures the services to launch and // assembles the P2P protocol stack. -func MakeSystemNode(name, version string, relconf release.Config, extra []byte, ctx *cli.Context) (*node.Node, []node.Service) { +func MakeSystemNode(name, version string, relconf release.Config, extra []byte, ctx *cli.Context) (*node.Node, *[]node.Service) { // Avoid conflicting network flags networks, netFlags := 0, []cli.BoolFlag{DevModeFlag, TestNetFlag, OlympicFlag} for _, flag := range netFlags { @@ -845,7 +845,7 @@ func MakeSystemNode(name, version string, relconf release.Config, extra []byte, } } - return stack, accountSync + return stack, &accountSync } // SetupNetwork configures the system for either the main net or some test network.