diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2013-06-03 15:18:41 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2013-06-03 15:18:41 +0200 |
commit | 39fe9de6b2b255969971beca8fa25a33ad2e5750 (patch) | |
tree | 6686041f6b801d0ea5185b026a480a5be61510e6 /src/rpcdump.cpp | |
parent | f679b2900a3a9f863f888cfb0b1a5e593628e37b (diff) | |
parent | fa9e5adddda0bee5adc040b957cf3f1a6a470802 (diff) |
Merge branch 'master' of git://github.com/bitcoin/bitcoin into prefsFix
Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
Conflicts:
bitcoin-qt.pro
Diffstat (limited to 'src/rpcdump.cpp')
-rw-r--r-- | src/rpcdump.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 77cef02736..d46309eaa4 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -54,20 +54,18 @@ Value importprivkey(const Array& params, bool fHelp) if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); - CKey key; - bool fCompressed; - CSecret secret = vchSecret.GetSecret(fCompressed); - key.SetSecret(secret, fCompressed); - CKeyID vchAddress = key.GetPubKey().GetID(); + CKey key = vchSecret.GetKey(); + CPubKey pubkey = key.GetPubKey(); + CKeyID vchAddress = pubkey.GetID(); { LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->MarkDirty(); pwalletMain->SetAddressBookName(vchAddress, strLabel); - if (!pwalletMain->AddKey(key)) + if (!pwalletMain->AddKeyPubKey(key, pubkey)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); - + if (fRescan) { pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); pwalletMain->ReacceptWalletTransactions(); @@ -91,9 +89,8 @@ Value dumpprivkey(const Array& params, bool fHelp) CKeyID keyID; if (!address.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key"); - CSecret vchSecret; - bool fCompressed; - if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed)) + CKey vchSecret; + if (!pwalletMain->GetKey(keyID, vchSecret)) throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); - return CBitcoinSecret(vchSecret, fCompressed).ToString(); + return CBitcoinSecret(vchSecret).ToString(); } |