mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
fix diff check
This commit is contained in:
parent
26d4ed0791
commit
1b8ae03034
1 changed files with 2 additions and 2 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue