From 957742f3b06c3ad351b603c8678e55ab997c78ba Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 14 May 2013 08:57:44 -0700 Subject: [PATCH] doLedger speedup. --- src/cpp/ripple/RPCHandler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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;