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

Function CastToBool

src/script/interpreter.cpp:35–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33} // namespace
34
35bool CastToBool(const valtype& vch)
36{
37 for (unsigned int i = 0; i < vch.size(); i++)
38 {
39 if (vch[i] != 0)
40 {
41 // Can be negative zero
42 if (i == vch.size()-1 && vch[i] == 0x80)
43 return false;
44 return true;
45 }
46 }
47 return false;
48}
49
50/**
51 * Script is a stack machine (like Forth) that evaluates a predicate

Callers 3

EvalScriptFunction · 0.85
VerifyWitnessProgramFunction · 0.85
VerifyScriptFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected