Small fixes.

pull/4377/head
frozen 2 years ago committed by Casey Gardiner
parent d8b66e0230
commit a240abb119
  1. 9
      cmd/harmony/main.go
  2. 2
      consensus/view_change_construct.go
  3. 3
      rpc/blockchain.go

@ -769,7 +769,7 @@ func setupConsensusAndNode(hc harmonyconfig.HarmonyConfig, nodeConfig *nodeconfi
)
nodeconfig.GetDefaultConfig().DBDir = nodeConfig.DBDir
processNodeType(hc, currentNode, currentConsensus)
currentConsensus.SetIsBackup(processNodeType(hc, currentNode))
currentNode.NodeConfig.SetShardGroupID(nodeconfig.NewGroupIDByShardID(nodeconfig.ShardID(nodeConfig.ShardID)))
currentNode.NodeConfig.SetClientGroupID(nodeconfig.NewClientGroupIDByShardID(shard.BeaconChainShardID))
currentNode.NodeConfig.ConsensusPriKey = nodeConfig.ConsensusPriKey
@ -821,7 +821,7 @@ func setupTiKV(hc harmonyconfig.HarmonyConfig) shardchain.DBFactory {
return factory
}
func processNodeType(hc harmonyconfig.HarmonyConfig, currentNode *node.Node, currentConsensus *consensus.Consensus) {
func processNodeType(hc harmonyconfig.HarmonyConfig, currentNode *node.Node) (isBackup bool) {
switch hc.General.NodeType {
case nodeTypeExplorer:
nodeconfig.SetDefaultRole(nodeconfig.ExplorerNode)
@ -831,10 +831,9 @@ func processNodeType(hc harmonyconfig.HarmonyConfig, currentNode *node.Node, cur
nodeconfig.SetDefaultRole(nodeconfig.Validator)
currentNode.NodeConfig.SetRole(nodeconfig.Validator)
if hc.General.IsBackup {
currentConsensus.SetIsBackup(true)
}
return hc.General.IsBackup
}
return false
}
func setupPprofService(node *node.Node, hc harmonyconfig.HarmonyConfig) {

@ -87,7 +87,7 @@ func (vc *viewChange) AddViewIDKeyIfNotExist(viewID uint64, members multibls.Pub
}
}
// Reset reset the state for viewchange
// Reset resets the state for viewChange.
func (vc *viewChange) Reset() {
vc.m1Payload = []byte{}
vc.bhpSigs = map[uint64]map[string]*bls_core.Sign{}

@ -2,13 +2,12 @@ package rpc
import (
"context"
"encoding/hex"
"fmt"
"math/big"
"reflect"
"time"
"encoding/hex"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"

Loading…
Cancel
Save