Skip to content

Commit

Permalink
fix getblocktemplate lock issue
Browse files Browse the repository at this point in the history
getblocktemplate didn't have a wallet lock before #5711 and IMO there is no need for LEAVE/ENTER critical section.
  • Loading branch information
jonasschnelli committed Feb 4, 2015
1 parent 93b7544 commit 17115d0
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/rpcmining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,6 @@ Value getblocktemplate(const Array& params, bool fHelp)
}

// Release the wallet and main lock while waiting
#ifdef ENABLE_WALLET
if(pwalletMain)
LEAVE_CRITICAL_SECTION(pwalletMain->cs_wallet);
#endif
LEAVE_CRITICAL_SECTION(cs_main);
{
checktxtime = boost::get_system_time() + boost::posix_time::minutes(1);
Expand All @@ -467,10 +463,6 @@ Value getblocktemplate(const Array& params, bool fHelp)
}
}
ENTER_CRITICAL_SECTION(cs_main);
#ifdef ENABLE_WALLET
if(pwalletMain)
ENTER_CRITICAL_SECTION(pwalletMain->cs_wallet);
#endif

if (!IsRPCRunning())
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down");
Expand Down

0 comments on commit 17115d0

Please sign in to comment.