aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2012-04-28 16:29:27 -0400
committerLuke Dashjr <luke-jr+git@utopios.org>2012-05-06 05:30:37 +0000
commitb94e6eb5a510315c4713ffc8bcfbfceb674691dc (patch)
tree1313534e01d0d4be1416fc46be36ae3b0f7f6ae8 /src/bitcoinrpc.cpp
parentee932c6e35f40360fbc3bce44840a82b19599ea2 (diff)
downloadbitcoin-b94e6eb5a510315c4713ffc8bcfbfceb674691dc.tar.xz
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)"
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 6525c15194..4426ac502e 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<CKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)