Skip to content

Commit

Permalink
Merge PR #5938: x/genutil: fix InitializeNodeValidatorFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze authored Apr 6, 2020
1 parent 5098548 commit 7d6033e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ when method receivers are offline/multisig keys.
types (eg. keys) to the `auth` module internal amino codec.
* (rest) [\#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending
invalid or incomplete requests.
* (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling.

### State Machine Breaking

Expand Down
6 changes: 3 additions & 3 deletions x/genutil/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ func InitializeNodeValidatorFiles(config *cfg.Config,

nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
if err != nil {
return nodeID, valPubKey, err
return "", nil, err
}

nodeID = string(nodeKey.ID())
server.UpgradeOldPrivValFile(config)

pvKeyFile := config.PrivValidatorKeyFile()
if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0777); err != nil {
return nodeID, valPubKey, nil
return "", nil, err
}

pvStateFile := config.PrivValidatorStateFile()
if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0777); err != nil {
return nodeID, valPubKey, nil
return "", nil, err
}

valPubKey = privval.LoadOrGenFilePV(pvKeyFile, pvStateFile).GetPubKey()
Expand Down

0 comments on commit 7d6033e

Please sign in to comment.