diff --git a/eth/backend.go b/eth/backend.go index 9f7ba79094..bb5f364624 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -205,15 +205,15 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { endBlockNumber := startBlockNumber + rCheckpoint - 1 signers := make(map[common.Address]*rewardLog) totalSigner := uint64(0) + // Get signers in blockSigner smartcontract. + client, err := contracts.GetEthClient(ctx) + if err != nil { + log.Error("Fail to connect IPC from blockSigner", "error", err) + return err + } for i := startBlockNumber; i <= endBlockNumber; i++ { - // Get signers in blockSigner smartcontract. - client, err := contracts.GetEthClient(ctx) - if err != nil { - log.Error("Fail to connect IPC from blockSigner", "error", err) - return err - } - addrs, err := contracts.GetSignersFromContract(client, i + addrs, err := contracts.GetSignersFromContract(client, i) if err != nil { log.Error("Fail to get signers from smartcontract.", "error", err, "blockNumber", i) return err @@ -420,7 +420,7 @@ func (self *Ethereum) SetEtherbase(etherbase common.Address) { } // ValidateMiner checks if node's address is in set of validators -func (s *Ethereum) ValidateMiner() (bool, error) { +func (s *Ethereum) ValidateStaker() (bool, error) { eb, err := s.Etherbase() if err != nil { return false, err @@ -442,7 +442,7 @@ func (s *Ethereum) ValidateMiner() (bool, error) { return true, nil } -func (s *Ethereum) StartMining(local bool) error { +func (s *Ethereum) StartStaking(local bool) error { eb, err := s.Etherbase() if err != nil { log.Error("Cannot start mining without etherbase", "err", err)