From e79656c7b86195543fb3b9576c7f421dfc370355 Mon Sep 17 00:00:00 2001 From: fsb4000 Date: Thu, 1 Jan 2015 09:32:43 +0600 Subject: [PATCH 1/1] return LOCK --- src/rpcdump.cpp | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index b734eb0..6184dfc 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -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)) -- 1.7.1