diff --git a/src/ripple/module/app/ledger/InboundLedger.cpp b/src/ripple/module/app/ledger/InboundLedger.cpp index 57b3c1427..5624a0294 100644 --- a/src/ripple/module/app/ledger/InboundLedger.cpp +++ b/src/ripple/module/app/ledger/InboundLedger.cpp @@ -1241,6 +1241,9 @@ Json::Value InboundLedger::getJson (int) { ret["have_state"] = mHaveState; ret["have_transactions"] = mHaveTransactions; + if (!mHaveState) + ret["state_nodes"] = static_cast + (mLedger->peekAccountStateMap()->size()); } if (mAborted) diff --git a/src/ripple/module/app/main/Application.cpp b/src/ripple/module/app/main/Application.cpp index e7d03c170..fca1bd7b6 100644 --- a/src/ripple/module/app/main/Application.cpp +++ b/src/ripple/module/app/main/Application.cpp @@ -1135,6 +1135,8 @@ bool ApplicationImp::loadOldLedger ( std::uint32_t seq = 1; std::uint32_t closeTime = getApp().getOPs().getCloseTimeNC (); + std::uint32_t closeTimeResolution = 30; + bool closeTimeEstimated = false; std::uint64_t totalCoins = 0; if (ledger.get().isMember ("accountState")) @@ -1147,6 +1149,16 @@ bool ApplicationImp::loadOldLedger ( { closeTime = ledger.get()["close_time"].asUInt(); } + if (ledger.get().isMember ("close_time_resolution")) + { + closeTimeResolution = + ledger.get()["close_time_resolution"].asUInt(); + } + if (ledger.get().isMember ("close_time_estimated")) + { + closeTimeEstimated = + ledger.get()["close_time_estimated"].asBool(); + } if (ledger.get().isMember ("total_coins")) { totalCoins = @@ -1188,7 +1200,8 @@ bool ApplicationImp::loadOldLedger ( } } - loadLedger->setAccepted(); + loadLedger->setAccepted (closeTime, + closeTimeResolution, ! closeTimeEstimated); } } } diff --git a/src/ripple/module/rpc/handlers/LedgerRequest.cpp b/src/ripple/module/rpc/handlers/LedgerRequest.cpp index c627d5155..f73ca6a27 100644 --- a/src/ripple/module/rpc/handlers/LedgerRequest.cpp +++ b/src/ripple/module/rpc/handlers/LedgerRequest.cpp @@ -75,10 +75,9 @@ Json::Value doLedgerRequest (RPC::Context& context) { // We don't have the ledger we need to figure out which ledger // they want. Try to get it. - getApp().getInboundLedgers().findCreate ( - refHash, refIndex, InboundLedger::fcGENERIC); + Json::Value jvResult = getApp().getInboundLedgers().findCreate ( + refHash, refIndex, InboundLedger::fcGENERIC)->getJson (0); - Json::Value jvResult; jvResult[jss::error] = "ledgerNotFound"; return jvResult; }