[blskey] add error message when blskey is nil

Signed-off-by: Leo Chen <leo@harmony.one>
pull/1113/head
Leo Chen 5 years ago
parent ffcc451b25
commit 292910b24b
  1. 4
      consensus/consensus.go

@ -2,6 +2,7 @@
package consensus // consensus
import (
"fmt"
"math/big"
"sync"
"time"
@ -256,6 +257,9 @@ func New(host p2p.Host, ShardID uint32, leader p2p.Peer, blsPriKey *bls.SecretKe
consensus.priKey = blsPriKey
consensus.PubKey = blsPriKey.GetPublicKey()
utils.GetLogInstance().Info("my pubkey is", "pubkey", consensus.PubKey.SerializeToHexStr())
} else {
utils.GetLogInstance().Error("the bls key is nil")
return nil, fmt.Errorf("nil bls key, aborting")
}
// viewID has to be initialized as the height of the blockchain during initialization

Loading…
Cancel
Save