| 136 | } |
| 137 | |
| 138 | static 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 | |
| 158 | TxoutType Solver(const CScript& scriptPubKey, std::vector<std::vector<unsigned char>>& vSolutionsRet) |
| 159 | { |
no test coverage detected