account sync pointer fix

This commit is contained in:
Daniel Whitenack 2016-07-01 10:43:55 -05:00
parent 2241ceccd4
commit f34cef1d47
3 changed files with 13 additions and 13 deletions

View File

@ -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")

View File

@ -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
}

View File

@ -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.