Changeset View
Changeset View
Standalone View
Standalone View
src/script/script.cpp
Show First 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | while (pc < end()) { | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool CScript::IsPushOnly() const { | bool CScript::IsPushOnly() const { | ||||
return this->IsPushOnly(begin()); | return this->IsPushOnly(begin()); | ||||
} | } | ||||
bool CScript::IsMinimalPushOnly() const { | |||||
const_iterator pc = begin(); | |||||
while (pc < end()) { | |||||
opcodetype opcode; | |||||
std::vector<uint8_t> vchPushValue; | |||||
if (!GetOp(pc, opcode, vchPushValue)) { | |||||
return false; | |||||
} | |||||
if (opcode <= OP_PUSHDATA4) { | |||||
if (!CheckMinimalPush(vchPushValue, opcode)) { | |||||
return false; | |||||
} | |||||
} else if (opcode > OP_16 || opcode == OP_RESERVED) { | |||||
return false; | |||||
} // else OP_1NEGATE or OP_1 to OP_16, always minimal. | |||||
} | |||||
return true; | |||||
} |