diff options
| author | Peter Todd <[email protected]> | 2012-04-28 16:29:27 -0400 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2012-05-06 05:30:43 +0000 |
| commit | e2b9bf9e6e846d2b182baf889f556e624c02e7a8 (patch) | |
| tree | f49e1cbf49377d707239fe398592aad2c7d75b16 /src/bitcoinrpc.cpp | |
| parent | Bugfix: %-12I64d is not valid and causes the parameter to be skipped, use %12... (diff) | |
| download | discoin-e2b9bf9e6e846d2b182baf889f556e624c02e7a8.tar.xz discoin-e2b9bf9e6e846d2b182baf889f556e624c02e7a8.zip | |
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.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 15bcf1da3..0b851c4e7 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -999,10 +999,12 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Gather public keys - if ((nRequired < 1) || ((int)keys.size() < nRequired)) + if (nRequired < 1) + throw runtime_error("a multisignature address must require at least one key to redeem"); + if ((int)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++) |