MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CastToBool

Function CastToBool

src/script/interpreter.cpp:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44} // namespace
45
46bool CastToBool(const valtype& vch)
47{
48 for (unsigned int i = 0; i < vch.size(); i++)
49 {
50 if (vch[i] != 0)
51 {
52 // Can be negative zero
53 if (i == vch.size()-1 && vch[i] == 0x80)
54 return false;
55 return true;
56 }
57 }
58 return false;
59}
60
61/**
62 * 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