have better error message for bls key init

pull/1019/head
Rongjian Lan 6 years ago
parent 0aa5b84c4b
commit d7c9a5948d
  1. 4
      cmd/harmony/main.go

@ -242,7 +242,7 @@ func createGlobalConfig() *nodeconfig.ConfigType {
if *isGenesis { if *isGenesis {
err := consensusPriKey.DeserializeHexStr(genesisAccount.BlsPriKey) err := consensusPriKey.DeserializeHexStr(genesisAccount.BlsPriKey)
if err != nil { if err != nil {
panic(fmt.Errorf("generate key error")) panic(fmt.Errorf("Failed to parse BLS private key: %s", genesisAccount.BlsPriKey))
} }
} else { } else {
// NewNode won't work // NewNode won't work
@ -263,7 +263,7 @@ func createGlobalConfig() *nodeconfig.ConfigType {
// Consensus keys are the BLS12-381 keys used to sign consensus messages // Consensus keys are the BLS12-381 keys used to sign consensus messages
nodeConfig.ConsensusPriKey, nodeConfig.ConsensusPubKey = consensusPriKey, consensusPriKey.GetPublicKey() nodeConfig.ConsensusPriKey, nodeConfig.ConsensusPubKey = consensusPriKey, consensusPriKey.GetPublicKey()
if nodeConfig.ConsensusPriKey == nil || nodeConfig.ConsensusPubKey == nil { if nodeConfig.ConsensusPriKey == nil || nodeConfig.ConsensusPubKey == nil {
panic(fmt.Errorf("generate key error")) panic(fmt.Errorf("Failed to initialize BLS keys: %s", consensusPriKey))
} }
// Key Setup ================= [End] // Key Setup ================= [End]

Loading…
Cancel
Save