Skip to content

Commit

Permalink
node: create am with backends for node
Browse files Browse the repository at this point in the history
  • Loading branch information
hadv committed Aug 28, 2023
1 parent 8cced57 commit 4a091d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ func New(conf *Config) (*Node, error) {
}
node.keyDir = keyDir
node.keyDirTemp = isEphem
// Creates an empty AccountManager with no backends. Callers (e.g. cmd/geth)
// are required to add the backends later on.
node.accman = accounts.NewManager(&accounts.Config{InsecureUnlockAllowed: conf.InsecureUnlockAllowed})
// Ensure that the AccountManager method works before the node has started. We rely on
// this in cmd/geth.
am, ephemeralKeystore, err := makeAccountManager(conf)
if err != nil {
return nil, err
}
node.accman = am
node.keyDir = ephemeralKeystore

// Initialize the p2p server. This creates the node key and discovery databases.
node.server.Config.PrivateKey = node.config.NodeKey()
Expand Down

0 comments on commit 4a091d8

Please sign in to comment.