mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Merge pull request #473 from nguyenbatam/fix_m1_equal_m2
fix signing with m1 = m2
This commit is contained in:
commit
65fb524a27
2 changed files with 8 additions and 2 deletions
|
|
@ -977,7 +977,13 @@ func (c *Posv) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
copy(header.Extra[len(header.Extra)-extraSeal:], sighash)
|
copy(header.Extra[len(header.Extra)-extraSeal:], sighash)
|
||||||
|
m2, err := c.GetValidator(signer, chain, header)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("can't get block validator: %v", err)
|
||||||
|
}
|
||||||
|
if m2 == signer {
|
||||||
|
header.Validator = sighash
|
||||||
|
}
|
||||||
return block.WithSeal(header), nil
|
return block.WithSeal(header), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ func (self *worker) wait() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
block := result.Block
|
block := result.Block
|
||||||
if self.config.Posv != nil && block.NumberU64() >= self.config.Posv.Epoch {
|
if self.config.Posv != nil && block.NumberU64() >= self.config.Posv.Epoch && len(block.Validator()) == 0 {
|
||||||
self.mux.Post(core.NewMinedBlockEvent{Block: block})
|
self.mux.Post(core.NewMinedBlockEvent{Block: block})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue