diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-10-13 13:56:54 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-10-13 13:57:07 +0200 |
| commit | d7e195048342afae9168377cebfc22ab000728a5 (patch) | |
| tree | ee5b07604ef073ef35d8aa13598fb7d6a4877bc4 /src/rpcdump.cpp | |
| parent | Merge pull request #5073 (diff) | |
| parent | [Wallet] Watch-only fixes (diff) | |
| download | discoin-d7e195048342afae9168377cebfc22ab000728a5.tar.xz discoin-d7e195048342afae9168377cebfc22ab000728a5.zip | |
Merge pull request #4937
ccca27a [Wallet] Watch-only fixes (Cozz Lovan)
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 1ac702455..9da0a7d09 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()) |