fix diff check

This commit is contained in:
jagdeep sidhu 2024-10-07 15:05:24 -07:00
parent 26d4ed0791
commit 1b8ae03034

View file

@ -257,7 +257,7 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
} }
// Verify the block's difficulty to ensure it's the default constant // Verify the block's difficulty to ensure it's the default constant
if !chain.Config().IsNexus(header.Number) { if !chain.Config().IsNexus(header.Number) {
if beaconDifficulty.Cmp(new(big.Int).SetInt64(1)) != 0 { if beaconDifficulty.Cmp(big.NewInt(1)) != 0 {
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, new(big.Int).SetInt64(1)) return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, new(big.Int).SetInt64(1))
} }
} else { } else {
@ -515,7 +515,7 @@ func (beacon *Beacon) IsPoSHeader(header *types.Header) bool {
panic("IsPoSHeader called with invalid difficulty") panic("IsPoSHeader called with invalid difficulty")
} }
// SYSCOIN // SYSCOIN
return header.Difficulty.Cmp(beaconDifficulty) <= 1 return header.Difficulty.Cmp(big.NewInt(1)) <= 0
} }
// InnerEngine returns the embedded eth1 consensus engine. // InnerEngine returns the embedded eth1 consensus engine.