mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge branch 'master' into misc
Conflicts: src/TransactionEngine.cpp
This commit is contained in:
@@ -317,7 +317,7 @@ Ledger::pointer Ledger::loadByHash(const uint256& ledgerHash)
|
||||
return getSQL(sql);
|
||||
}
|
||||
|
||||
void Ledger::addJson(Json::Value& ret)
|
||||
void Ledger::addJson(Json::Value& ret, int options)
|
||||
{
|
||||
Json::Value ledger(Json::objectValue);
|
||||
|
||||
@@ -336,6 +336,22 @@ void Ledger::addJson(Json::Value& ret)
|
||||
else ledger["Closed"] = false;
|
||||
if (mCloseTime != 0)
|
||||
ledger["CloseTime"] = boost::posix_time::to_simple_string(ptFromSeconds(mCloseTime));
|
||||
if ((options & LEDGER_JSON_DUMP_TXNS) != 0)
|
||||
{
|
||||
Json::Value txns(Json::arrayValue);
|
||||
for (SHAMapItem::pointer item = mTransactionMap->peekFirstItem(); !!item;
|
||||
item = mTransactionMap->peekNextItem(item->getTag()))
|
||||
txns.append(item->getTag().GetHex());
|
||||
ledger["Transactions"] = txns;
|
||||
}
|
||||
if ((options & LEDGER_JSON_DUMP_STATE) != 0)
|
||||
{
|
||||
Json::Value state(Json::arrayValue);
|
||||
for (SHAMapItem::pointer item = mAccountStateMap->peekFirstItem(); !!item;
|
||||
item = mAccountStateMap->peekNextItem(item->getTag()))
|
||||
state.append(item->getTag().GetHex());
|
||||
ledger["AccountState"] = state;
|
||||
}
|
||||
ret[boost::lexical_cast<std::string>(mLedgerSeq)] = ledger;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user