MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / MatchMultisig

Function MatchMultisig

src/script/standard.cpp:72–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72static bool MatchMultisig(const CScript& script, unsigned int& required, std::vector<valtype>& pubkeys)
73{
74 opcodetype opcode;
75 valtype data;
76 CScript::const_iterator it = script.begin();
77 if (script.size() < 1 || script.back() != OP_CHECKMULTISIG) return false;
78
79 if (!script.GetOp(it, opcode, data) || !IsSmallInteger(opcode)) return false;
80 required = CScript::DecodeOP_N(opcode);
81 while (script.GetOp(it, opcode, data) && CPubKey::ValidSize(data)) {
82 pubkeys.emplace_back(std::move(data));
83 }
84 if (!IsSmallInteger(opcode)) return false;
85 unsigned int keys = CScript::DecodeOP_N(opcode);
86 if (pubkeys.size() != keys || keys < required) return false;
87 return (it + 1 == script.end());
88}
89
90bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet)
91{

Callers 1

SolverFunction · 0.85

Calls 5

IsSmallIntegerFunction · 0.85
GetOpMethod · 0.80
beginMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected