Fix RPC handlers to use the results of lookupLedger.

This commit is contained in:
Tom Ritchford
2014-11-19 21:53:27 -05:00
committed by Nik Bougalis
parent 64d0f7fffd
commit 445b29ad0d
2 changed files with 7 additions and 10 deletions

View File

@@ -85,10 +85,9 @@ Json::Value doLedger (RPC::Context& context)
}
Json::Value ret (Json::objectValue);
lpLedger->addJson (ret, iOptions);
lpLedger->addJson (jvResult, iOptions);
return ret;
return jvResult;
}
} // ripple

View File

@@ -77,12 +77,10 @@ Json::Value doLedgerData (RPC::Context& context)
if ((limit < 0) || ((limit > maxLimit) && (context.role != Role::ADMIN)))
limit = maxLimit;
Json::Value jvReply = Json::objectValue;
jvResult["ledger_hash"] = to_string (lpLedger->getHash());
jvResult["ledger_index"] = std::to_string( lpLedger->getLedgerSeq ());
jvReply["ledger_hash"] = to_string (lpLedger->getHash());
jvReply["ledger_index"] = std::to_string( lpLedger->getLedgerSeq ());
Json::Value& nodes = (jvReply["state"] = Json::arrayValue);
Json::Value& nodes = (jvResult["state"] = Json::arrayValue);
SHAMap& map = *(lpLedger->peekAccountStateMap ());
for (;;)
@@ -95,7 +93,7 @@ Json::Value doLedgerData (RPC::Context& context)
if (limit-- <= 0)
{
--resumePoint;
jvReply["marker"] = to_string (resumePoint);
jvResult["marker"] = to_string (resumePoint);
break;
}
@@ -114,7 +112,7 @@ Json::Value doLedgerData (RPC::Context& context)
}
}
return jvReply;
return jvResult;
}
} // ripple