mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 08:32:30 +01:00
refactor: Enforce lowercase hex digits for consteval uint256
Also changes compile-time asserts with comments into throws.
This commit is contained in:
@@ -177,7 +177,7 @@ void sanity_check_chainparams(const ArgsManager& args, ChainType chain_type)
|
||||
|
||||
// check max target * 4*nPowTargetTimespan doesn't overflow -- see pow.cpp:CalculateNextWorkRequired()
|
||||
if (!consensus.fPowNoRetargeting) {
|
||||
arith_uint256 targ_max{UintToArith256(uint256{"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"})};
|
||||
arith_uint256 targ_max{UintToArith256(uint256{"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"})};
|
||||
targ_max /= consensus.nPowTargetTimespan*4;
|
||||
BOOST_CHECK(UintToArith256(consensus.powLimit) < targ_max);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user