mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
by pass difficulty check in some scenes
This commit is contained in:
parent
7a7abd4f75
commit
1dba188d1d
1 changed files with 1 additions and 8 deletions
|
|
@ -578,14 +578,6 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p
|
||||||
return errUnauthorized
|
return errUnauthorized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//Ensure that the difficulty corresponds to the turn-ness of the signer
|
|
||||||
inturn := snap.inturn(header.Number.Uint64(), signer)
|
|
||||||
if inturn && header.Difficulty.Cmp(diffInTurn) != 0 {
|
|
||||||
return errInvalidDifficulty
|
|
||||||
}
|
|
||||||
if !inturn && header.Difficulty.Cmp(diffNoTurn) != 0 {
|
|
||||||
return errInvalidDifficulty
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -760,6 +752,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch
|
||||||
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(masternodes)/2 + 1); number < limit || seen > number-limit {
|
if limit := uint64(len(masternodes)/2 + 1); number < limit || seen > number-limit {
|
||||||
|
log.Info("Debugging", "len(masternodes)", len(masternodes), "number", number, "limit", limit, "seen", seen, "recent", recent.String(), "snap.Recents", snap.Recents)
|
||||||
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