Skip to content

Commit

Permalink
Merge pull request ethereum#259 from nguyenbatam/remove_useless_code
Browse files Browse the repository at this point in the history
remove useless code
  • Loading branch information
thanhson1085 authored Nov 6, 2018
2 parents 60c05f3 + 6cee868 commit 252ae51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions consensus/posv/posv.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func (c *Posv) verifySeal(chain consensus.ChainReader, header *types.Header, par
}

// verify validator
assignedValidator, err := c.GetValidator(creator, snap, chain, header)
assignedValidator, err := c.GetValidator(creator, chain, header)
if err != nil {
return err
}
Expand All @@ -664,7 +664,7 @@ func (c *Posv) verifySeal(chain consensus.ChainReader, header *types.Header, par
return nil
}

func (c *Posv) GetValidator(creator common.Address, snap *Snapshot, chain consensus.ChainReader, header *types.Header) (common.Address, error) {
func (c *Posv) GetValidator(creator common.Address, chain consensus.ChainReader, header *types.Header) (common.Address, error) {
epoch := c.config.Epoch
no := header.Number.Uint64()
cpNo := no
Expand Down
7 changes: 1 addition & 6 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,11 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
log.Error("Cannot get etherbase for append m2 header", "err", err)
return block, fmt.Errorf("etherbase missing: %v", err)
}
// Get m1.
snap, err := c.GetSnapshot(eth.blockchain, eth.blockchain.CurrentHeader())
if err != nil {
return block, fmt.Errorf("can't get snapshot: %v", err)
}
m1, err := c.RecoverSigner(block.Header())
if err != nil {
return block, fmt.Errorf("can't get block creator: %v", err)
}
m2, err := c.GetValidator(m1, snap, eth.blockchain, block.Header())
m2, err := c.GetValidator(m1, eth.blockchain, block.Header())
if err != nil {
return block, fmt.Errorf("can't get block validator: %v", err)
}
Expand Down

0 comments on commit 252ae51

Please sign in to comment.