GetScriptOp

Reads the next opcode, and any pushed data, from a script.

Synopsis

Declared in <script/script.h>

bool
GetScriptOp(
    CScriptBase::const_iterator& pc,
    CScriptBase::const_iterator end,
    opcodetype& opcodeRet,
    std::vector<unsigned char>* pvchRet);

Return Value

true if an opcode was read successfully, false on malformed input.

Parameters

NameDescription
pcIn/out iterator to the current position; advanced past the opcode.
endIterator to the end of the script.
opcodeRetSet to the opcode that was read.
pvchRetIf not null, set to the data pushed by the opcode.