MCPcopy Create free account
hub / github.com/ElementsProject/elements / MatchMultisig

Function MatchMultisig

src/script/standard.cpp:138–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138static bool MatchMultisig(const CScript& script, int& required_sigs, std::vector<valtype>& pubkeys)
139{
140 opcodetype opcode;
141 valtype data;
142 int num_keys;
143
144 CScript::const_iterator it = script.begin();
145 if (script.size() < 1 || script.back() != OP_CHECKMULTISIG) return false;
146
147 if (!script.GetOp(it, opcode, data) || !GetMultisigKeyCount(opcode, data, required_sigs)) return false;
148 while (script.GetOp(it, opcode, data) && CPubKey::ValidSize(data)) {
149 pubkeys.emplace_back(std::move(data));
150 }
151 if (!GetMultisigKeyCount(opcode, data, num_keys)) return false;
152
153 if (pubkeys.size() != static_cast<unsigned long>(num_keys) || num_keys < required_sigs) return false;
154
155 return (it + 1 == script.end());
156}
157
158TxoutType Solver(const CScript& scriptPubKey, std::vector<std::vector<unsigned char>>& vSolutionsRet)
159{

Callers 1

SolverFunction · 0.85

Calls 6

GetMultisigKeyCountFunction · 0.85
GetOpMethod · 0.80
emplace_backMethod · 0.80
beginMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected