updated backend.go

This commit is contained in:
AnilChinchawale 2018-07-18 17:16:14 +05:30
parent 8fd30116d5
commit d7f57b92e3

View file

@ -334,6 +334,7 @@ func (self *Ethereum) SetEtherbase(etherbase common.Address) {
self.miner.SetEtherbase(etherbase)
}
// ValidateMiner checks if node's address is in set of validators
func (s *Ethereum) ValidateMiner() (bool, error) {
eb, err := s.Etherbase()
if err != nil {
@ -353,20 +354,9 @@ func (s *Ethereum) ValidateMiner() (bool, error) {
} else {
return false, fmt.Errorf("Only verify miners in Clique protocol")
}
return true, nil
}
func (s *Ethereum) Checkpoint() bool {
number := s.blockchain.CurrentHeader().Number.Uint64()
return number%s.chainConfig.Clique.Epoch == 1 || number == 0
}
func (s *Ethereum) Checkpoint() bool {
number := s.blockchain.CurrentHeader().Number.Uint64()
return number%s.chainConfig.Clique.Epoch == 1
}
func (s *Ethereum) StartMining(local bool) error {
eb, err := s.Etherbase()
if err != nil {