[rpc] Account for ExplorerNode with BLS keys changes for NodeMetadata

pull/2600/head
Janet Liang 5 years ago
parent 7f1dd41fc8
commit fb4dabedd9
  1. 8
      internal/hmyapi/apiv1/harmony.go
  2. 8
      internal/hmyapi/apiv2/harmony.go

@ -72,9 +72,11 @@ func (s *PublicHarmonyAPI) GetNodeMetadata() NodeMetadata {
blockEpoch = &b
}
var blsKeys []string
for _, key := range cfg.ConsensusPubKey.PublicKey {
blsKeys = append(blsKeys, key.SerializeToHexStr())
blsKeys := []string{}
if cfg.ConsensusPubKey != nil {
for _, key := range cfg.ConsensusPubKey.PublicKey {
blsKeys = append(blsKeys, key.SerializeToHexStr())
}
}
return NodeMetadata{

@ -71,9 +71,11 @@ func (s *PublicHarmonyAPI) GetNodeMetadata() NodeMetadata {
blockEpoch = &b
}
var blsKeys []string
for _, key := range cfg.ConsensusPubKey.PublicKey {
blsKeys = append(blsKeys, key.SerializeToHexStr())
blsKeys := []string{}
if cfg.ConsensusPubKey != nil {
for _, key := range cfg.ConsensusPubKey.PublicKey {
blsKeys = append(blsKeys, key.SerializeToHexStr())
}
}
return NodeMetadata{

Loading…
Cancel
Save