return LOCK
[novacoin.git] / 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))