Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | static UniValue createmultisig(const Config &config, | ||||
} | } | ||||
int required = request.params[0].get_int(); | int required = request.params[0].get_int(); | ||||
// Get the public keys | // Get the public keys | ||||
const UniValue &keys = request.params[1].get_array(); | const UniValue &keys = request.params[1].get_array(); | ||||
std::vector<CPubKey> pubkeys; | std::vector<CPubKey> pubkeys; | ||||
for (size_t i = 0; i < keys.size(); ++i) { | for (size_t i = 0; i < keys.size(); ++i) { | ||||
if (IsHex(keys[i].get_str()) && (keys[i].get_str().length() == 66 || | if ((keys[i].get_str().length() == | ||||
keys[i].get_str().length() == 130)) { | 2 * CPubKey::COMPRESSED_PUBLIC_KEY_SIZE || | ||||
keys[i].get_str().length() == 2 * CPubKey::PUBLIC_KEY_SIZE) && | |||||
IsHex(keys[i].get_str())) { | |||||
pubkeys.push_back(HexToPubKey(keys[i].get_str())); | pubkeys.push_back(HexToPubKey(keys[i].get_str())); | ||||
} else { | } else { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_ADDRESS_OR_KEY, | RPC_INVALID_ADDRESS_OR_KEY, | ||||
strprintf("Invalid public key: %s\n", keys[i].get_str())); | strprintf("Invalid public key: %s\n", keys[i].get_str())); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 441 Lines • Show Last 20 Lines |