From: Peter Todd Date: Sat, 28 Apr 2012 20:29:27 +0000 (-0400) Subject: Fixed non-sensical error message X-Git-Tag: v0.4.0-unstable~129^2~1^2^2~17 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=b94e6eb5a510315c4713ffc8bcfbfceb674691dc Fixed non-sensical error message Previously trying to create a multisig address that required less than one signature would output something like the following: "wrong number of keys(got 1, need at least 0)" --- diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 6525c15..4426ac5 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1002,10 +1002,12 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Gather public keys - if (nRequired < 1 || keys.size() < nRequired) + if (nRequired < 1) + throw runtime_error("a multisignature address must require at least one key to redeem"); + if (keys.size() < nRequired) throw runtime_error( - strprintf("wrong number of keys" - "(got %d, need at least %d)", keys.size(), nRequired)); + strprintf("not enough keys supplied " + "(got %d keys, but need at least %d to redeem)", keys.size(), nRequired)); std::vector pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++)