X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcdump.cpp;h=6184dfc49cf3035514c4ea36037a5bd8d186d00a;hb=e79656c7b86195543fb3b9576c7f421dfc370355;hp=b734eb049e5129a081b56e986305538ad393a078;hpb=7ed0a0850fe91716b520d2798d3b0d8f82047bab;p=novacoin.git 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))