diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-07-26 21:05:11 +0200 |
---|---|---|
committer | Cozz Lovan <cozzlovan@yahoo.com> | 2014-10-03 04:29:51 +0200 |
commit | ccca27a788fe1ae13661308243c20a1d7a3d0074 (patch) | |
tree | b862f0f1e0fe98fdd1957cc2236076fef899cc50 /src/rpcdump.cpp | |
parent | 29f96e8bc652cb14c6fdefe5279ee983054faa2a (diff) |
[Wallet] Watch-only fixes
Diffstat (limited to 'src/rpcdump.cpp')
-rw-r--r-- | src/rpcdump.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 1ac7024550..9da0a7d091 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -114,8 +114,6 @@ Value importprivkey(const Array& params, bool fHelp) CPubKey pubkey = key.GetPubKey(); CKeyID vchAddress = pubkey.GetID(); { - LOCK2(cs_main, pwalletMain->cs_wallet); - pwalletMain->MarkDirty(); pwalletMain->SetAddressBook(vchAddress, strLabel, "receive"); @@ -181,7 +179,8 @@ Value importaddress(const Array& params, bool fHelp) fRescan = params[2].get_bool(); { - LOCK2(cs_main, pwalletMain->cs_wallet); + if (::IsMine(*pwalletMain, script) == ISMINE_SPENDABLE) + throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the private key for this address or script"); // add to address book or update label if (address.IsValid()) |