From 1dba188d1d1be75c23f2b566a9c1a65565af0784 Mon Sep 17 00:00:00 2001 From: MestryOmkar Date: Sun, 28 Oct 2018 10:45:17 +0530 Subject: [PATCH] by pass difficulty check in some scenes --- consensus/clique/clique.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 91eb04ec66..9b9c8612ff 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -578,14 +578,6 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p 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 } @@ -760,6 +752,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch if recent == signer { // 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 { + 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") <-stop return nil, nil