mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
fuzz: enable running fuzz test cases in Debug mode
When building with BUILD_FOR_FUZZING=OFF BUILD_FUZZ_BINARY=ON CMAKE_BUILD_TYPE=Debug allow the fuzz binary to execute given test cases (without actual fuzzing) to make it easier to reproduce fuzz test failures in a more normal debug build. In Debug builds, deterministic fuzz behaviour is controlled via a runtime variable, which is normally false, but set to true automatically in the fuzz binary, unless the FUZZ_NONDETERMINISM environment variable is set.
This commit is contained in:
@@ -139,7 +139,7 @@ bool PermittedDifficultyTransition(const Consensus::Params& params, int64_t heig
|
||||
// the most significant bit of the last byte of the hash is set.
|
||||
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params)
|
||||
{
|
||||
if constexpr (G_FUZZING) return (hash.data()[31] & 0x80) == 0;
|
||||
if (EnableFuzzDeterminism()) return (hash.data()[31] & 0x80) == 0;
|
||||
return CheckProofOfWorkImpl(hash, nBits, params);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user