Skip to content

Commit

Permalink
set diff = 1 for tm
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi Zhou committed Mar 7, 2022
1 parent 82a12de commit 8056ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions consensus/tendermint/tendermint.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (c *Tendermint) verifyHeader(chain consensus.ChainHeaderReader, header *typ
}
// Ensure that the block's difficulty is meaningful (may not be correct at this point)
if number > 0 {
if header.Difficulty == nil || (header.Difficulty.Cmp(big.NewInt(int64(number))) != 0) {
if header.Difficulty == nil || (header.Difficulty.Cmp(big.NewInt(1)) != 0) {
return errInvalidDifficulty
}
}
Expand Down Expand Up @@ -374,7 +374,7 @@ func (c *Tendermint) Prepare(chain consensus.ChainHeaderReader, header *types.He

header.TimeMs = timestamp
header.Time = timestamp / 1000
header.Difficulty = big.NewInt(int64(number))
header.Difficulty = big.NewInt(1)

if (number % c.config.Epoch) != 0 {
header.NextValidators = []common.Address{}
Expand Down

0 comments on commit 8056ed6

Please sign in to comment.