mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
hotfix: signed recently issue
This commit is contained in:
parent
bdf9dd8802
commit
7e33e27642
1 changed files with 3 additions and 2 deletions
|
|
@ -718,9 +718,10 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
masternodes := []common.Address{}
|
||||||
if _, authorized := snap.Signers[signer]; !authorized {
|
if _, authorized := snap.Signers[signer]; !authorized {
|
||||||
valid := false
|
valid := false
|
||||||
masternodes := c.GetMasternodes(chain, header)
|
masternodes = c.GetMasternodes(chain, header)
|
||||||
for _, m := range masternodes {
|
for _, m := range masternodes {
|
||||||
if m == signer {
|
if m == signer {
|
||||||
valid = true
|
valid = true
|
||||||
|
|
@ -735,7 +736,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
|
||||||
for seen, recent := range snap.Recents {
|
for seen, recent := range snap.Recents {
|
||||||
if recent == signer {
|
if recent == signer {
|
||||||
// Signer is among recents, only wait if the current block doesn't shift it out
|
// Signer is among recents, only wait if the current block doesn't shift it out
|
||||||
if limit := uint64(len(snap.Signers)/2 + 1); number < limit || seen > number-limit {
|
if limit := uint64(len(masternodes)/2 + 1); number < limit || seen > number-limit {
|
||||||
log.Info("Signed recently, must wait for others")
|
log.Info("Signed recently, must wait for others")
|
||||||
<-stop
|
<-stop
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue