MCPcopy Create free account
hub / github.com/citp/BlockSci / MatchMultisig

Function MatchMultisig

tools/parser/script_output.cpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65static bool MatchMultisig(const CScriptView& script, ScriptOutputData<blocksci::AddressType::Enum::MULTISIG> &multisig)
66{
67 opcodetype opcode;
68 valtype data;
69 CScriptView::iterator it = script.begin();
70 if (script.size() < 1 || script.back() != OP_CHECKMULTISIG) return false;
71
72 if (!script.GetOp(it, opcode, data) || !IsSmallInteger(opcode)) return false;
73 multisig.numRequired = CScript::DecodeOP_N(opcode);
74 while (script.GetOp(it, opcode, data) && CPubKey::ValidSize(data | ranges::to_vector)) {
75 multisig.addAddress(data);
76 }
77 if (!IsSmallInteger(opcode)) return false;
78 multisig.numTotal = CScript::DecodeOP_N(opcode);
79 return (it + 1 == script.end());
80}
81
82
83ScriptOutputDataType extractScriptData(const blocksci::CScriptView &scriptPubKey, bool p2shActivated, bool witnessActivated) {

Callers 1

extractScriptDataFunction · 0.85

Calls 7

IsSmallIntegerFunction · 0.85
ValidSizeFunction · 0.85
beginMethod · 0.45
sizeMethod · 0.45
GetOpMethod · 0.45
addAddressMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected