Make G_FUZZING constexpr, require -DBUILD_FOR_FUZZING=ON to execute a fuzz target

This commit is contained in:
MarcoFalke
2024-10-31 13:53:48 +01:00
parent fae3cf0ffa
commit fafbf8acf4
5 changed files with 17 additions and 7 deletions

View File

@@ -139,7 +139,7 @@ bool PermittedDifficultyTransition(const Consensus::Params& params, int64_t heig
// the most signficant bit of the last byte of the hash is set.
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params)
{
if (g_fuzzing) return (hash.data()[31] & 0x80) == 0;
if constexpr (G_FUZZING) return (hash.data()[31] & 0x80) == 0;
return CheckProofOfWorkImpl(hash, nBits, params);
}