mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
Make miniscript fuzzers avoid ops limit
Keep track of the total number of ops the constructed script will have during miniscript_stable and miniscript_smart fuzzers' GenNode, so it can abort early if the 201 ops limit would be exceeded. Also add a self-check that the final constructed node has the predicted ops size limit, so we know the fuzzer's logic for keeping track of this is correct.
This commit is contained in:
@@ -1136,6 +1136,9 @@ public:
|
||||
//! Return the maximum number of ops needed to satisfy this script non-malleably.
|
||||
uint32_t GetOps() const { return ops.count + ops.sat.value; }
|
||||
|
||||
//! Return the number of ops in the script (not counting the dynamic ones that depend on execution).
|
||||
uint32_t GetStaticOps() const { return ops.count; }
|
||||
|
||||
//! Check the ops limit of this script against the consensus limit.
|
||||
bool CheckOpsLimit() const { return GetOps() <= MAX_OPS_PER_SCRIPT; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user