MCPcopy Create free account
hub / github.com/LUX-Core/lux / CastToBool

Function CastToBool

src/script/interpreter.cpp:41–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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