Skip to content

Commit

Permalink
Avoid redundant unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelKatz committed Mar 31, 2014
1 parent 5a21269 commit 14830c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ripple_app/rpc/RPCHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3900,6 +3900,7 @@ Json::Value RPCHandler::doSubscribe (Json::Value params, Resource::Charge& loadT
}
}

bool bHaveMasterLock = true;
if (!params.isMember ("books"))
{
nothing ();
Expand Down Expand Up @@ -4010,7 +4011,11 @@ Json::Value RPCHandler::doSubscribe (Json::Value params, Resource::Charge& loadT

if (bSnapshot)
{
masterLockHolder.unlock ();
if (bHaveMasterLock)
{
masterLockHolder.unlock ();
bHaveMasterLock = false;
}

loadType = Resource::feeMediumBurdenRPC;
Ledger::pointer lpLedger = getApp().getLedgerMaster ().getPublishedLedger ();
Expand Down

0 comments on commit 14830c7

Please sign in to comment.