MCPcopy Create free account
hub / github.com/ElementsProject/elements / CastToBool

Function CastToBool

src/script/interpreter.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43} // namespace
44
45bool CastToBool(const valtype& vch)
46{
47 for (unsigned int i = 0; i < vch.size(); i++)
48 {
49 if (vch[i] != 0)
50 {
51 // Can be negative zero
52 if (i == vch.size()-1 && vch[i] == 0x80)
53 return false;
54 return true;
55 }
56 }
57 return false;
58}
59
60/**
61 * Script is a stack machine (like Forth) that evaluates a predicate

Callers 4

EvalScriptFunction · 0.85
ExecuteWitnessScriptFunction · 0.85
VerifyScriptFunction · 0.85
FUZZ_TARGETFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

FUZZ_TARGETFunction · 0.68