Fixed code review.

pull/4509/head
frozen 2 years ago committed by Casey Gardiner
parent f72199c9ba
commit 808c9e67fe
  1. 2
      consensus/consensus_v2.go
  2. 2
      hmy/hmy.go
  3. 6
      node/api.go

@ -691,7 +691,7 @@ func (consensus *Consensus) rotateLeader(epoch *big.Int) {
if header == nil {
return
}
// Previous epoch, we should not change leader.
// Previous block was epoch block, we should not change leader.
if header.Epoch().Uint64() != epoch.Uint64() {
return
}

@ -18,7 +18,6 @@ import (
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/core/vm"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/multibls"
commonRPC "github.com/harmony-one/harmony/rpc/common"
"github.com/harmony-one/harmony/shard"
staking "github.com/harmony-one/harmony/staking/types"
@ -97,7 +96,6 @@ type NodeAPI interface {
GetStakingTransactionsCount(address, txType string) (uint64, error)
GetTraceResultByHash(hash common.Hash) (json.RawMessage, error)
IsCurrentlyLeader() bool
GetPublicKeys() multibls.PublicKeys
IsOutOfSync(shardID uint32) bool
SyncStatus(shardID uint32) (bool, uint64, uint64)
SyncPeers() map[string]int

@ -6,7 +6,6 @@ import (
"github.com/harmony-one/harmony/eth/rpc"
"github.com/harmony-one/harmony/hmy"
"github.com/harmony-one/harmony/internal/tikv"
"github.com/harmony-one/harmony/multibls"
"github.com/harmony-one/harmony/rosetta"
hmy_rpc "github.com/harmony-one/harmony/rpc"
rpc_common "github.com/harmony-one/harmony/rpc/common"
@ -19,11 +18,6 @@ func (node *Node) IsCurrentlyLeader() bool {
return node.Consensus.IsLeader()
}
// GetPublicKeys exposes if node is currently the leader node
func (node *Node) GetPublicKeys() multibls.PublicKeys {
return node.Consensus.GetPrivateKeys().GetPublicKeys()
}
// PeerConnectivity ..
func (node *Node) PeerConnectivity() (int, int, int) {
return node.host.PeerConnectivity()

Loading…
Cancel
Save