diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index ba49aa01b..01809a7dd 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -1868,15 +1868,16 @@ Json::Value RPCHandler::doLedger(Json::Value jvRequest, int& cost, ScopedLock& M | (bTransactions ? LEDGER_JSON_DUMP_TXRP : 0) | (bAccounts ? LEDGER_JSON_DUMP_STATE : 0); - if (bFull && !lpLedger->isImmutable()) - { // For full, it's cheaper to snapshot + if ((bFull || bAccounts) && !lpLedger->isImmutable()) + { // For full or accounts, it's cheaper to snapshot lpLedger = boost::make_shared(*lpLedger, true); + assert(lpLedger->isImmutable()); } - Json::Value ret(Json::objectValue); - if (lpLedger->isImmutable()) MasterLockHolder.unlock(); + + Json::Value ret(Json::objectValue); lpLedger->addJson(ret, iOptions); return ret;