aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-01-23 12:04:34 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-01-23 12:04:34 -0500
commitdc77dce07cd1f528b7bd2b4c9594cd4647866b08 (patch)
tree5ebab7dd24a746a6f8ebabf9095fe7d08b00f2bf
parent1240a1b0a82e0e944a6fdcf6ff26001e1bd68904 (diff)
downloadbitcoin-dc77dce07cd1f528b7bd2b4c9594cd4647866b08.tar.xz
Fixed addmultisigaddress if looking up public keys from locked wallets.
-rw-r--r--src/bitcoinrpc.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 5ac58de06d..3063abd1fa 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -1025,9 +1025,12 @@ Value addmultisigaddress(const Array& params, bool fHelp)
if (address.IsScript())
throw runtime_error(
strprintf("%s is a pay-to-script address",ks.c_str()));
- if (!pwalletMain->GetKey(address, pubkeys[i]))
+ std::vector<unsigned char> vchPubKey;
+ if (!pwalletMain->GetPubKey(address, vchPubKey))
throw runtime_error(
strprintf("no full public key for address %s",ks.c_str()));
+ if (vchPubKey.empty() || !pubkeys[i].SetPubKey(vchPubKey))
+ throw runtime_error(" Invalid public key: "+ks);
}
// Case 2: hex public key