return LOCK
authorfsb4000 <fsb4000@yandex.ru>
Thu, 1 Jan 2015 03:32:43 +0000 (09:32 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Thu, 1 Jan 2015 03:32:43 +0000 (09:32 +0600)
src/rpcdump.cpp

index b734eb0..6184dfc 100644 (file)
@@ -97,6 +97,7 @@ Value importaddress(const Array& params, bool fHelp)
         fRescan = params[2].get_bool();
 
     {
+        LOCK2(cs_main, pwalletMain->cs_wallet);
         if (::IsMine(*pwalletMain, script) == MINE_SPENDABLE)
             throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the private key for this address or script");
 
@@ -152,6 +153,8 @@ Value removeaddress(const Array& params, bool fHelp)
     if (!pwalletMain->HaveWatchOnly(script))
         throw JSONRPCError(RPC_WALLET_ERROR, "The wallet does not contain this address or script");
 
+    LOCK2(cs_main, pwalletMain->cs_wallet);
+
     pwalletMain->MarkDirty();
 
     if (!pwalletMain->RemoveWatchOnly(script))