diff --git a/src/cpp/ripple/Ledger.cpp b/src/cpp/ripple/Ledger.cpp index 5df54ae999..812e0d0a30 100644 --- a/src/cpp/ripple/Ledger.cpp +++ b/src/cpp/ripple/Ledger.cpp @@ -817,6 +817,7 @@ Json::Value Ledger::getJson(int options) { Json::Value txns(Json::arrayValue); SHAMapTreeNode::TNType type; + ScopedLock l(mTransactionMap->Lock()); for (SHAMapItem::pointer item = mTransactionMap->peekFirstItem(type); !!item; item = mTransactionMap->peekNextItem(item->getTag(), type)) { @@ -856,6 +857,7 @@ Json::Value Ledger::getJson(int options) if (mAccountStateMap && (bFull || ((options & LEDGER_JSON_DUMP_STATE) != 0))) { Json::Value state(Json::arrayValue); + ScopedLock l(mAccountStateMap->Lock()); for (SHAMapItem::pointer item = mAccountStateMap->peekFirstItem(); !!item; item = mAccountStateMap->peekNextItem(item->getTag())) { diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index 43ecc71607..68817cc97d 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -1526,6 +1526,7 @@ Json::Value RPCHandler::doLedger(Json::Value jvRequest) Json::Value ret(Json::objectValue); + ScopedUnlock(theApp->getMasterLock()); ledger->addJson(ret, full ? LEDGER_JSON_FULL : 0); return ret;