mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 21:45:52 +00:00
Accelerated 'ledger' command.
This commit is contained in:
@@ -817,6 +817,7 @@ Json::Value Ledger::getJson(int options)
|
|||||||
{
|
{
|
||||||
Json::Value txns(Json::arrayValue);
|
Json::Value txns(Json::arrayValue);
|
||||||
SHAMapTreeNode::TNType type;
|
SHAMapTreeNode::TNType type;
|
||||||
|
ScopedLock l(mTransactionMap->Lock());
|
||||||
for (SHAMapItem::pointer item = mTransactionMap->peekFirstItem(type); !!item;
|
for (SHAMapItem::pointer item = mTransactionMap->peekFirstItem(type); !!item;
|
||||||
item = mTransactionMap->peekNextItem(item->getTag(), type))
|
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)))
|
if (mAccountStateMap && (bFull || ((options & LEDGER_JSON_DUMP_STATE) != 0)))
|
||||||
{
|
{
|
||||||
Json::Value state(Json::arrayValue);
|
Json::Value state(Json::arrayValue);
|
||||||
|
ScopedLock l(mAccountStateMap->Lock());
|
||||||
for (SHAMapItem::pointer item = mAccountStateMap->peekFirstItem(); !!item;
|
for (SHAMapItem::pointer item = mAccountStateMap->peekFirstItem(); !!item;
|
||||||
item = mAccountStateMap->peekNextItem(item->getTag()))
|
item = mAccountStateMap->peekNextItem(item->getTag()))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1526,6 +1526,7 @@ Json::Value RPCHandler::doLedger(Json::Value jvRequest)
|
|||||||
|
|
||||||
Json::Value ret(Json::objectValue);
|
Json::Value ret(Json::objectValue);
|
||||||
|
|
||||||
|
ScopedUnlock(theApp->getMasterLock());
|
||||||
ledger->addJson(ret, full ? LEDGER_JSON_FULL : 0);
|
ledger->addJson(ret, full ? LEDGER_JSON_FULL : 0);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user