| 116 | } |
| 117 | |
| 118 | static bool GetMultisigKeyCount(opcodetype opcode, valtype data, int& count) |
| 119 | { |
| 120 | if (IsSmallInteger(opcode)) { |
| 121 | count = CScript::DecodeOP_N(opcode); |
| 122 | return IsValidMultisigKeyCount(count); |
| 123 | } |
| 124 | |
| 125 | if (IsPushdataOp(opcode)) { |
| 126 | if (!CheckMinimalPush(data, opcode)) return false; |
| 127 | try { |
| 128 | count = CScriptNum(data, /* fRequireMinimal = */ true).getint(); |
| 129 | return IsValidMultisigKeyCount(count); |
| 130 | } catch (const scriptnum_error&) { |
| 131 | return false; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | static bool MatchMultisig(const CScript& script, int& required_sigs, std::vector<valtype>& pubkeys) |
| 139 | { |
no test coverage detected