mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 18:45:55 +00:00
Replace Ledger with ReadView in most RPC handlers.
This commit is contained in:
committed by
Vinnie Falco
parent
c7ebe7205c
commit
1d09c54fdc
@@ -91,7 +91,7 @@ public:
|
|||||||
// Used for ledgers loaded from JSON files
|
// Used for ledgers loaded from JSON files
|
||||||
Ledger (uint256 const& parentHash, uint256 const& transHash,
|
Ledger (uint256 const& parentHash, uint256 const& transHash,
|
||||||
uint256 const& accountHash,
|
uint256 const& accountHash,
|
||||||
std::uint64_t totCoins, std::uint32_t closeTime,
|
std::uint64_t totDrops, std::uint32_t closeTime,
|
||||||
std::uint32_t parentCloseTime, int closeFlags, int closeResolution,
|
std::uint32_t parentCloseTime, int closeFlags, int closeResolution,
|
||||||
std::uint32_t ledgerSeq, bool & loaded);
|
std::uint32_t ledgerSeq, bool & loaded);
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ public:
|
|||||||
uint256 const&
|
uint256 const&
|
||||||
getHash();
|
getHash();
|
||||||
|
|
||||||
void setTotalCoins (std::uint64_t totDrops)
|
void setTotalDrops (std::uint64_t totDrops)
|
||||||
{
|
{
|
||||||
info_.drops = totDrops;
|
info_.drops = totDrops;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ public:
|
|||||||
// This is the last ledger we published to clients and can lag the validated ledger
|
// This is the last ledger we published to clients and can lag the validated ledger
|
||||||
virtual Ledger::ref getPublishedLedger () = 0;
|
virtual Ledger::ref getPublishedLedger () = 0;
|
||||||
|
|
||||||
|
virtual bool isValidLedger(LedgerInfo const&) = 0;
|
||||||
|
|
||||||
virtual int getPublishedLedgerAge () = 0;
|
virtual int getPublishedLedgerAge () = 0;
|
||||||
virtual int getValidatedLedgerAge () = 0;
|
virtual int getValidatedLedgerAge () = 0;
|
||||||
virtual bool isCaughtUp(std::string& reason) = 0;
|
virtual bool isCaughtUp(std::string& reason) = 0;
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ Blob serializeBlob(Object const& o)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Serialize an object to a hex string. */
|
/** Serialize an object to a hex string. */
|
||||||
template <class Object>
|
inline
|
||||||
std::string serializeHex(Object const& o)
|
std::string serializeHex(STObject const& o)
|
||||||
{
|
{
|
||||||
return strHex(serializeBlob(o));
|
return strHex(serializeBlob(o));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1264,6 +1264,36 @@ public:
|
|||||||
return mPubLedger;
|
return mPubLedger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isValidLedger(LedgerInfo const& info) override
|
||||||
|
{
|
||||||
|
if (info.validated)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (info.open)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
auto seq = info.seq;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Use the skip list in the last validated ledger to see if ledger
|
||||||
|
// comes before the last validated ledger (and thus has been
|
||||||
|
// validated).
|
||||||
|
auto hash = walkHashBySeq (seq);
|
||||||
|
if (info.hash != hash)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (SHAMapMissingNode const&)
|
||||||
|
{
|
||||||
|
WriteLog (lsWARNING, RPCHandler)
|
||||||
|
<< "Missing SHANode " << std::to_string (seq);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark ledger as validated to save time if we see it again.
|
||||||
|
info.validated = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int getMinValidations ()
|
int getMinValidations ()
|
||||||
{
|
{
|
||||||
return mMinValidations;
|
return mMinValidations;
|
||||||
|
|||||||
@@ -90,32 +90,29 @@ void fillJsonTx (Object& json, LedgerFill const& fill)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using value_type = ReadView::txs_type::value_type;
|
for (auto& i: fill.ledger.txs)
|
||||||
forEachTx(fill.ledger, [&] (value_type const& i) {
|
{
|
||||||
count.yield();
|
count.yield();
|
||||||
|
|
||||||
if (! bExpanded)
|
if (! bExpanded)
|
||||||
{
|
{
|
||||||
txns.append(to_string(i.first->getTransactionID()));
|
txns.append(to_string(i.first->getTransactionID()));
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
else if (bBinary)
|
||||||
auto&& txJson = appendObject (txns);
|
|
||||||
|
|
||||||
if (bBinary)
|
|
||||||
{
|
{
|
||||||
|
auto&& txJson = appendObject (txns);
|
||||||
txJson[jss::tx_blob] = serializeHex(*i.first);
|
txJson[jss::tx_blob] = serializeHex(*i.first);
|
||||||
if (i.second)
|
if (i.second)
|
||||||
txJson[jss::meta] = serializeHex(*i.second);
|
txJson[jss::meta] = serializeHex(*i.second);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
auto&& txJson = appendObject (txns);
|
||||||
copyFrom(txJson, i.first->getJson(0));
|
copyFrom(txJson, i.first->getJson(0));
|
||||||
if (i.second)
|
if (i.second)
|
||||||
txJson[jss::metaData] = i.second->getJson(0);
|
txJson[jss::metaData] = i.second->getJson(0);
|
||||||
}
|
}
|
||||||
return true;
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1164,7 +1164,7 @@ bool ApplicationImp::loadOldLedger (
|
|||||||
std::uint32_t closeTime = getApp().getOPs().getCloseTimeNC ();
|
std::uint32_t closeTime = getApp().getOPs().getCloseTimeNC ();
|
||||||
std::uint32_t closeTimeResolution = 30;
|
std::uint32_t closeTimeResolution = 30;
|
||||||
bool closeTimeEstimated = false;
|
bool closeTimeEstimated = false;
|
||||||
std::uint64_t totalCoins = 0;
|
std::uint64_t totalDrops = 0;
|
||||||
|
|
||||||
if (ledger.get().isMember ("accountState"))
|
if (ledger.get().isMember ("accountState"))
|
||||||
{
|
{
|
||||||
@@ -1188,7 +1188,7 @@ bool ApplicationImp::loadOldLedger (
|
|||||||
}
|
}
|
||||||
if (ledger.get().isMember ("total_coins"))
|
if (ledger.get().isMember ("total_coins"))
|
||||||
{
|
{
|
||||||
totalCoins =
|
totalDrops =
|
||||||
beast::lexicalCastThrow<std::uint64_t>
|
beast::lexicalCastThrow<std::uint64_t>
|
||||||
(ledger.get()["total_coins"].asString());
|
(ledger.get()["total_coins"].asString());
|
||||||
}
|
}
|
||||||
@@ -1201,7 +1201,7 @@ bool ApplicationImp::loadOldLedger (
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
loadLedger = std::make_shared<Ledger> (seq, closeTime);
|
loadLedger = std::make_shared<Ledger> (seq, closeTime);
|
||||||
loadLedger->setTotalCoins(totalCoins);
|
loadLedger->setTotalDrops(totalDrops);
|
||||||
|
|
||||||
for (Json::UInt index = 0; index < ledger.get().size(); ++index)
|
for (Json::UInt index = 0; index < ledger.get().size(); ++index)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -217,9 +217,11 @@ public:
|
|||||||
// Book functions.
|
// Book functions.
|
||||||
//
|
//
|
||||||
|
|
||||||
void getBookPage (bool bAdmin, Ledger::pointer lpLedger, Book const&,
|
void getBookPage (bool bAdmin, std::shared_ptr<ReadView const>& lpLedger,
|
||||||
AccountID const& uTakerID, const bool bProof, const unsigned int iLimit,
|
Book const&, AccountID const& uTakerID, const bool bProof,
|
||||||
Json::Value const& jvMarker, Json::Value& jvResult) override;
|
const unsigned int iLimit,
|
||||||
|
Json::Value const& jvMarker, Json::Value& jvResult)
|
||||||
|
override;
|
||||||
|
|
||||||
// Ledger proposal/close functions.
|
// Ledger proposal/close functions.
|
||||||
void processTrustedProposal (
|
void processTrustedProposal (
|
||||||
@@ -2640,7 +2642,7 @@ InfoSub::pointer NetworkOPsImp::addRpcSub (
|
|||||||
// FIXME : support iLimit.
|
// FIXME : support iLimit.
|
||||||
void NetworkOPsImp::getBookPage (
|
void NetworkOPsImp::getBookPage (
|
||||||
bool bAdmin,
|
bool bAdmin,
|
||||||
Ledger::pointer lpLedger,
|
std::shared_ptr<ReadView const>& lpLedger,
|
||||||
Book const& book,
|
Book const& book,
|
||||||
AccountID const& uTakerID,
|
AccountID const& uTakerID,
|
||||||
bool const bProof,
|
bool const bProof,
|
||||||
@@ -2864,7 +2866,7 @@ void NetworkOPsImp::getBookPage (
|
|||||||
// FIXME : support iLimit.
|
// FIXME : support iLimit.
|
||||||
void NetworkOPsImp::getBookPage (
|
void NetworkOPsImp::getBookPage (
|
||||||
bool bAdmin,
|
bool bAdmin,
|
||||||
Ledger::pointer lpLedger,
|
std::shared_ptr<ReadView const> lpLedger,
|
||||||
Book const& book,
|
Book const& book,
|
||||||
AccountID const& uTakerID,
|
AccountID const& uTakerID,
|
||||||
bool const bProof,
|
bool const bProof,
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public:
|
|||||||
|
|
||||||
virtual void getBookPage (
|
virtual void getBookPage (
|
||||||
bool bAdmin,
|
bool bAdmin,
|
||||||
Ledger::pointer lpLedger,
|
std::shared_ptr<ReadView const>& lpLedger,
|
||||||
Book const& book,
|
Book const& book,
|
||||||
AccountID const& uTakerID,
|
AccountID const& uTakerID,
|
||||||
bool const bProof,
|
bool const bProof,
|
||||||
|
|||||||
@@ -322,17 +322,6 @@ void forEachSLE(ReadView const& view, Functor func, uint256 const& start = {})
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Run a functor on each transaction in a ReadView, as long as the functor
|
|
||||||
returns true. Might throw an exception if the ledger is corrupt. */
|
|
||||||
template <class Functor>
|
|
||||||
void forEachTx(ReadView const& view, Functor func)
|
|
||||||
{
|
|
||||||
for (auto i = view.txs.begin(); i != view.txs.begin(); ++i)
|
|
||||||
if (i->first)
|
|
||||||
if (! func(*i))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // ripple
|
} // ripple
|
||||||
|
|
||||||
#include <ripple/ledger/detail/ReadViewFwdRange.ipp>
|
#include <ripple/ledger/detail/ReadViewFwdRange.ipp>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Json::Value doAccountCurrencies (RPC::Context& context)
|
|||||||
auto& params = context.params;
|
auto& params = context.params;
|
||||||
|
|
||||||
// Get the current ledger
|
// Get the current ledger
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
if (!ledger)
|
if (!ledger)
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Json::Value doAccountInfo (RPC::Context& context)
|
|||||||
{
|
{
|
||||||
auto& params = context.params;
|
auto& params = context.params;
|
||||||
|
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
|
|
||||||
if (!ledger)
|
if (!ledger)
|
||||||
@@ -58,16 +58,13 @@ Json::Value doAccountInfo (RPC::Context& context)
|
|||||||
if (jvAccepted)
|
if (jvAccepted)
|
||||||
return jvAccepted;
|
return jvAccepted;
|
||||||
|
|
||||||
auto const sleAccepted = cachedRead(*ledger,
|
auto const sleAccepted = ledger->read(keylet::account(accountID));
|
||||||
keylet::account(accountID).key, ltACCOUNT_ROOT);
|
|
||||||
|
|
||||||
if (sleAccepted)
|
if (sleAccepted)
|
||||||
{
|
{
|
||||||
injectSLE(jvAccepted, *sleAccepted);
|
injectSLE(jvAccepted, *sleAccepted);
|
||||||
|
|
||||||
// See if there's a SignerEntries for this account.
|
// See if there's a SignerEntries for this account.
|
||||||
uint256 const signerListIndex = getSignerListIndex (accountID);
|
auto const signerList = ledger->read (keylet::signers(accountID));
|
||||||
auto const signerList = cachedRead(*ledger, signerListIndex);
|
|
||||||
|
|
||||||
if (signerList)
|
if (signerList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Json::Value doAccountLines (RPC::Context& context)
|
|||||||
if (! params.isMember (jss::account))
|
if (! params.isMember (jss::account))
|
||||||
return RPC::missing_field_error (jss::account);
|
return RPC::missing_field_error (jss::account);
|
||||||
|
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
if (! ledger)
|
if (! ledger)
|
||||||
return result;
|
return result;
|
||||||
@@ -152,9 +152,9 @@ Json::Value doAccountLines (RPC::Context& context)
|
|||||||
return RPC::expected_field_error (jss::marker, "string");
|
return RPC::expected_field_error (jss::marker, "string");
|
||||||
|
|
||||||
startAfter.SetHex (marker.asString ());
|
startAfter.SetHex (marker.asString ());
|
||||||
auto const sleLine = cachedRead(*ledger, startAfter);
|
auto const sleLine = ledger->read({ltRIPPLE_STATE, startAfter});
|
||||||
|
|
||||||
if (sleLine == nullptr || sleLine->getType () != ltRIPPLE_STATE)
|
if (! sleLine)
|
||||||
return rpcError (rpcINVALID_PARAMS);
|
return rpcError (rpcINVALID_PARAMS);
|
||||||
|
|
||||||
if (sleLine->getFieldAmount (sfLowLimit).getIssuer () == accountID)
|
if (sleLine->getFieldAmount (sfLowLimit).getIssuer () == accountID)
|
||||||
@@ -180,7 +180,6 @@ Json::Value doAccountLines (RPC::Context& context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// VFALCO Needs a caching view here
|
|
||||||
if (! forEachItemAfter(*ledger, accountID,
|
if (! forEachItemAfter(*ledger, accountID,
|
||||||
startAfter, startHint, reserve,
|
startAfter, startHint, reserve,
|
||||||
[&visitData](std::shared_ptr<SLE const> const& sleCur)
|
[&visitData](std::shared_ptr<SLE const> const& sleCur)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Json::Value doAccountObjects (RPC::Context& context)
|
|||||||
if (! params.isMember (jss::account))
|
if (! params.isMember (jss::account))
|
||||||
return RPC::missing_field_error (jss::account);
|
return RPC::missing_field_error (jss::account);
|
||||||
|
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
if (ledger == nullptr)
|
if (ledger == nullptr)
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
|||||||
if (! params.isMember (jss::account))
|
if (! params.isMember (jss::account))
|
||||||
return RPC::missing_field_error (jss::account);
|
return RPC::missing_field_error (jss::account);
|
||||||
|
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
if (! ledger)
|
if (! ledger)
|
||||||
return result;
|
return result;
|
||||||
@@ -108,11 +108,9 @@ Json::Value doAccountOffers (RPC::Context& context)
|
|||||||
return RPC::expected_field_error (jss::marker, "string");
|
return RPC::expected_field_error (jss::marker, "string");
|
||||||
|
|
||||||
startAfter.SetHex (marker.asString ());
|
startAfter.SetHex (marker.asString ());
|
||||||
auto const sleOffer = cachedRead (*ledger, startAfter);
|
auto const sleOffer = ledger->read({ltOFFER, startAfter});
|
||||||
|
|
||||||
if (sleOffer == nullptr ||
|
if (! sleOffer || accountID != sleOffer->getAccountID (sfAccount))
|
||||||
sleOffer->getType () != ltOFFER ||
|
|
||||||
accountID != sleOffer->getAccountID (sfAccount))
|
|
||||||
{
|
{
|
||||||
return rpcError (rpcINVALID_PARAMS);
|
return rpcError (rpcINVALID_PARAMS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Json::Value doAccountTx (RPC::Context& context)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto ret = RPC::lookupLedger (ledger, context);
|
auto ret = RPC::lookupLedger (ledger, context);
|
||||||
|
|
||||||
if (! ledger)
|
if (! ledger)
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ Json::Value doAccountTxOld (RPC::Context& context)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto ret = RPC::lookupLedger (ledger, context);
|
auto ret = RPC::lookupLedger (ledger, context);
|
||||||
|
|
||||||
if (!ledger)
|
if (!ledger)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Json::Value doBookOffers (RPC::Context& context)
|
|||||||
if (getApp().getJobQueue ().getJobCountGE (jtCLIENT) > 200)
|
if (getApp().getJobQueue ().getJobCountGE (jtCLIENT) > 200)
|
||||||
return rpcError (rpcTOO_BUSY);
|
return rpcError (rpcTOO_BUSY);
|
||||||
|
|
||||||
Ledger::pointer lpLedger;
|
std::shared_ptr<ReadView const> lpLedger;
|
||||||
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
||||||
|
|
||||||
if (!lpLedger)
|
if (!lpLedger)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Json::Value doCanDelete (RPC::Context& context)
|
|||||||
canDeleteStr.find_first_not_of("0123456789abcdef") ==
|
canDeleteStr.find_first_not_of("0123456789abcdef") ==
|
||||||
std::string::npos)
|
std::string::npos)
|
||||||
{
|
{
|
||||||
Ledger::pointer ledger = context.ledgerMaster.getLedgerByHash (
|
auto ledger = context.ledgerMaster.getLedgerByHash (
|
||||||
from_hex_text<uint256>(canDeleteStr));
|
from_hex_text<uint256>(canDeleteStr));
|
||||||
|
|
||||||
if (!ledger)
|
if (!ledger)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Json::Value doGatewayBalances (RPC::Context& context)
|
|||||||
auto& params = context.params;
|
auto& params = context.params;
|
||||||
|
|
||||||
// Get the current ledger
|
// Get the current ledger
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
|
|
||||||
if (!ledger)
|
if (!ledger)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Status LedgerHandler::check ()
|
|||||||
if (!needsLedger)
|
if (!needsLedger)
|
||||||
return Status::OK;
|
return Status::OK;
|
||||||
|
|
||||||
if (auto s = RPC::lookupLedger (ledger_, context_, result_))
|
if (auto s = lookupLedger (ledger_, context_, result_))
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
bool bFull = params[jss::full].asBool();
|
bool bFull = params[jss::full].asBool();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Context& context_;
|
Context& context_;
|
||||||
Ledger::pointer ledger_;
|
std::shared_ptr<ReadView const> ledger_;
|
||||||
Json::Value result_;
|
Json::Value result_;
|
||||||
int options_ = 0;
|
int options_ = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ namespace ripple {
|
|||||||
// marker: resume point, if any
|
// marker: resume point, if any
|
||||||
Json::Value doLedgerData (RPC::Context& context)
|
Json::Value doLedgerData (RPC::Context& context)
|
||||||
{
|
{
|
||||||
int const BINARY_PAGE_LENGTH = 2048;
|
static int const BINARY_PAGE_LENGTH = 2048;
|
||||||
int const JSON_PAGE_LENGTH = 256;
|
static int const JSON_PAGE_LENGTH = 256;
|
||||||
|
|
||||||
Ledger::pointer lpLedger;
|
std::shared_ptr<ReadView const> lpLedger;
|
||||||
auto const& params = context.params;
|
auto const& params = context.params;
|
||||||
|
|
||||||
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
auto jvResult = RPC::lookupLedger(lpLedger, context);
|
||||||
if (!lpLedger)
|
if (!lpLedger)
|
||||||
return jvResult;
|
return jvResult;
|
||||||
|
|
||||||
@@ -48,9 +48,7 @@ Json::Value doLedgerData (RPC::Context& context)
|
|||||||
if (params.isMember (jss::marker))
|
if (params.isMember (jss::marker))
|
||||||
{
|
{
|
||||||
Json::Value const& jMarker = params[jss::marker];
|
Json::Value const& jMarker = params[jss::marker];
|
||||||
if (!jMarker.isString ())
|
if (! (jMarker.isString () && resumePoint.SetHex (jMarker.asString ())))
|
||||||
return RPC::expected_field_error (jss::marker, "valid");
|
|
||||||
if (!resumePoint.SetHex (jMarker.asString ()))
|
|
||||||
return RPC::expected_field_error (jss::marker, "valid");
|
return RPC::expected_field_error (jss::marker, "valid");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,40 +69,33 @@ Json::Value doLedgerData (RPC::Context& context)
|
|||||||
if ((limit < 0) || ((limit > maxLimit) && (context.role != Role::ADMIN)))
|
if ((limit < 0) || ((limit > maxLimit) && (context.role != Role::ADMIN)))
|
||||||
limit = maxLimit;
|
limit = maxLimit;
|
||||||
|
|
||||||
jvResult[jss::ledger_hash] = to_string (lpLedger->getHash());
|
jvResult[jss::ledger_hash] = to_string (lpLedger->info().hash);
|
||||||
jvResult[jss::ledger_index] = std::to_string( lpLedger->info().seq);
|
jvResult[jss::ledger_index] = std::to_string(lpLedger->info().seq);
|
||||||
|
|
||||||
Json::Value& nodes = (jvResult[jss::state] = Json::arrayValue);
|
Json::Value& nodes = (jvResult[jss::state] = Json::arrayValue);
|
||||||
auto& map = lpLedger->stateMap();
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
auto item = map.peekNextItem (resumePoint);
|
|
||||||
if (!item)
|
|
||||||
break;
|
|
||||||
resumePoint = item->key();
|
|
||||||
|
|
||||||
|
forEachSLE(*lpLedger, [&] (SLE const& sle) {
|
||||||
if (limit-- <= 0)
|
if (limit-- <= 0)
|
||||||
{
|
{
|
||||||
--resumePoint;
|
auto marker = sle.key();
|
||||||
jvResult[jss::marker] = to_string (resumePoint);
|
jvResult[jss::marker] = to_string (--marker);
|
||||||
break;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBinary)
|
if (isBinary)
|
||||||
{
|
{
|
||||||
Json::Value& entry = nodes.append (Json::objectValue);
|
Json::Value& entry = nodes.append (Json::objectValue);
|
||||||
entry[jss::data] = strHex (
|
entry[jss::data] = serializeHex(sle);
|
||||||
item->peekData().begin(), item->peekData().size());
|
entry[jss::index] = to_string (sle.key());
|
||||||
entry[jss::index] = to_string (item->key());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SLE sle (SerialIter{item->data(), item->size()}, item->key());
|
|
||||||
Json::Value& entry = nodes.append (sle.getJson (0));
|
Json::Value& entry = nodes.append (sle.getJson (0));
|
||||||
entry[jss::index] = to_string (item->key());
|
entry[jss::index] = to_string (sle.key());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
return jvResult;
|
return jvResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace ripple {
|
|||||||
// }
|
// }
|
||||||
Json::Value doLedgerEntry (RPC::Context& context)
|
Json::Value doLedgerEntry (RPC::Context& context)
|
||||||
{
|
{
|
||||||
Ledger::pointer lpLedger;
|
std::shared_ptr<ReadView const> lpLedger;
|
||||||
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
||||||
|
|
||||||
if (!lpLedger)
|
if (!lpLedger)
|
||||||
@@ -201,8 +201,7 @@ Json::Value doLedgerEntry (RPC::Context& context)
|
|||||||
|
|
||||||
if (uNodeIndex.isNonZero ())
|
if (uNodeIndex.isNonZero ())
|
||||||
{
|
{
|
||||||
auto const sleNode = cachedRead(*lpLedger, uNodeIndex);
|
auto const sleNode = lpLedger->read(keylet::unchecked(uNodeIndex));
|
||||||
|
|
||||||
if (context.params.isMember(jss::binary))
|
if (context.params.isMember(jss::binary))
|
||||||
bNodeBinary = context.params[jss::binary].asBool();
|
bNodeBinary = context.params[jss::binary].asBool();
|
||||||
|
|
||||||
|
|||||||
@@ -28,16 +28,14 @@ namespace ripple {
|
|||||||
// }
|
// }
|
||||||
Json::Value doLedgerHeader (RPC::Context& context)
|
Json::Value doLedgerHeader (RPC::Context& context)
|
||||||
{
|
{
|
||||||
Ledger::pointer lpLedger;
|
std::shared_ptr<ReadView const> lpLedger;
|
||||||
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
auto jvResult = RPC::lookupLedger (lpLedger, context);
|
||||||
|
|
||||||
if (!lpLedger)
|
if (!lpLedger)
|
||||||
return jvResult;
|
return jvResult;
|
||||||
|
|
||||||
Serializer s;
|
Serializer s;
|
||||||
|
addRaw (lpLedger->info(), s);
|
||||||
lpLedger->addRaw (s);
|
|
||||||
|
|
||||||
jvResult[jss::ledger_data] = strHex (s.peekData ());
|
jvResult[jss::ledger_data] = strHex (s.peekData ());
|
||||||
|
|
||||||
// This information isn't verified: they should only use it if they trust
|
// This information isn't verified: they should only use it if they trust
|
||||||
|
|||||||
@@ -29,14 +29,15 @@ static void fillTransaction (
|
|||||||
Json::Value& txArray,
|
Json::Value& txArray,
|
||||||
AccountID const& accountID,
|
AccountID const& accountID,
|
||||||
std::uint32_t& sequence,
|
std::uint32_t& sequence,
|
||||||
Ledger::ref ledger)
|
ReadView const& ledger)
|
||||||
{
|
{
|
||||||
txArray["Sequence"] = Json::UInt (sequence++);
|
txArray["Sequence"] = Json::UInt (sequence++);
|
||||||
txArray["Account"] = getApp().accountIDCache().toBase58 (accountID);
|
txArray["Account"] = getApp().accountIDCache().toBase58 (accountID);
|
||||||
// VFALCO Needs audit
|
// VFALCO Needs audit
|
||||||
// Why are we hard-coding 10?
|
// Why are we hard-coding 10?
|
||||||
|
auto& fees = ledger.fees();
|
||||||
txArray["Fee"] = Json::UInt (getApp().getFeeTrack().scaleFeeLoad(
|
txArray["Fee"] = Json::UInt (getApp().getFeeTrack().scaleFeeLoad(
|
||||||
10, ledger->fees().base, ledger->fees().units, false));
|
10, fees.base, fees.units, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// {
|
// {
|
||||||
@@ -83,7 +84,7 @@ Json::Value doNoRippleCheck (RPC::Context& context)
|
|||||||
if (params.isMember (jss::transactions))
|
if (params.isMember (jss::transactions))
|
||||||
transactions = params["transactions"].asBool();
|
transactions = params["transactions"].asBool();
|
||||||
|
|
||||||
Ledger::pointer ledger;
|
std::shared_ptr<ReadView const> ledger;
|
||||||
auto result = RPC::lookupLedger (ledger, context);
|
auto result = RPC::lookupLedger (ledger, context);
|
||||||
if (! ledger)
|
if (! ledger)
|
||||||
return result;
|
return result;
|
||||||
@@ -103,8 +104,7 @@ Json::Value doNoRippleCheck (RPC::Context& context)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto const sle = cachedRead(*ledger,
|
auto const sle = ledger->read(keylet::account(accountID));
|
||||||
keylet::account(accountID).key, ltACCOUNT_ROOT);
|
|
||||||
if (! sle)
|
if (! sle)
|
||||||
return rpcError (rpcACT_NOT_FOUND);
|
return rpcError (rpcACT_NOT_FOUND);
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ Json::Value doNoRippleCheck (RPC::Context& context)
|
|||||||
Json::Value& tx = jvTransactions.append (Json::objectValue);
|
Json::Value& tx = jvTransactions.append (Json::objectValue);
|
||||||
tx["TransactionType"] = "AccountSet";
|
tx["TransactionType"] = "AccountSet";
|
||||||
tx["SetFlag"] = 8;
|
tx["SetFlag"] = 8;
|
||||||
fillTransaction (tx, accountID, seq, ledger);
|
fillTransaction (tx, accountID, seq, *ledger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ Json::Value doNoRippleCheck (RPC::Context& context)
|
|||||||
tx["TransactionType"] = "TrustSet";
|
tx["TransactionType"] = "TrustSet";
|
||||||
tx["LimitAmount"] = limitAmount.getJson (0);
|
tx["LimitAmount"] = limitAmount.getJson (0);
|
||||||
tx["Flags"] = bNoRipple ? tfClearNoRipple : tfSetNoRipple;
|
tx["Flags"] = bNoRipple ? tfClearNoRipple : tfSetNoRipple;
|
||||||
fillTransaction(tx, accountID, seq, ledger);
|
fillTransaction(tx, accountID, seq, *ledger);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ripple {
|
|||||||
|
|
||||||
Json::Value doPathFind (RPC::Context& context)
|
Json::Value doPathFind (RPC::Context& context)
|
||||||
{
|
{
|
||||||
Ledger::pointer lpLedger = context.ledgerMaster.getClosedLedger();
|
auto lpLedger = context.ledgerMaster.getClosedLedger();
|
||||||
|
|
||||||
if (!context.params.isMember (jss::subcommand) ||
|
if (!context.params.isMember (jss::subcommand) ||
|
||||||
!context.params[jss::subcommand].isString ())
|
!context.params[jss::subcommand].isString ())
|
||||||
@@ -35,7 +35,7 @@ Json::Value doPathFind (RPC::Context& context)
|
|||||||
if (!context.infoSub)
|
if (!context.infoSub)
|
||||||
return rpcError (rpcNO_EVENTS);
|
return rpcError (rpcNO_EVENTS);
|
||||||
|
|
||||||
std::string sSubCommand = context.params[jss::subcommand].asString ();
|
auto sSubCommand = context.params[jss::subcommand].asString ();
|
||||||
|
|
||||||
if (sSubCommand == "create")
|
if (sSubCommand == "create")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ Json::Value doRipplePathFind (RPC::Context& context)
|
|||||||
context.params.isMember(jss::ledger_hash))
|
context.params.isMember(jss::ledger_hash))
|
||||||
{
|
{
|
||||||
// The caller specified a ledger
|
// The caller specified a ledger
|
||||||
jvResult = RPC::lookupLedger (lpLedger, context);
|
jvResult = RPC::lookupLedgerDeprecated (lpLedger, context);
|
||||||
if (!lpLedger)
|
if (!lpLedger)
|
||||||
return jvResult;
|
return jvResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -292,8 +292,8 @@ Json::Value doSubscribe (RPC::Context& context)
|
|||||||
if (bSnapshot)
|
if (bSnapshot)
|
||||||
{
|
{
|
||||||
context.loadType = Resource::feeMediumBurdenRPC;
|
context.loadType = Resource::feeMediumBurdenRPC;
|
||||||
auto lpLedger = getApp().getLedgerMaster ().
|
std::shared_ptr<ReadView const> lpLedger
|
||||||
getPublishedLedger ();
|
= getApp().getLedgerMaster().getPublishedLedger();
|
||||||
if (lpLedger)
|
if (lpLedger)
|
||||||
{
|
{
|
||||||
const Json::Value jvMarker = Json::Value (Json::nullValue);
|
const Json::Value jvMarker = Json::Value (Json::nullValue);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace ripple {
|
|||||||
Json::Value doTransactionEntry (RPC::Context& context)
|
Json::Value doTransactionEntry (RPC::Context& context)
|
||||||
{
|
{
|
||||||
Ledger::pointer lpLedger;
|
Ledger::pointer lpLedger;
|
||||||
Json::Value jvResult = RPC::lookupLedger (lpLedger, context);
|
Json::Value jvResult = RPC::lookupLedgerDeprecated (lpLedger, context);
|
||||||
|
|
||||||
if (!lpLedger)
|
if (!lpLedger)
|
||||||
return jvResult;
|
return jvResult;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace ripple {
|
|||||||
namespace RPC {
|
namespace RPC {
|
||||||
|
|
||||||
bool
|
bool
|
||||||
getAccountObjects (Ledger const& ledger, AccountID const& account,
|
getAccountObjects (ReadView const& ledger, AccountID const& account,
|
||||||
LedgerEntryType const type, uint256 dirIndex, uint256 const& entryIndex,
|
LedgerEntryType const type, uint256 dirIndex, uint256 const& entryIndex,
|
||||||
std::uint32_t const limit, Json::Value& jvResult)
|
std::uint32_t const limit, Json::Value& jvResult)
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
|||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dir = cachedRead(ledger, dirIndex, ltDIR_NODE);
|
auto dir = ledger.read({ltDIR_NODE, dirIndex});
|
||||||
if (! dir)
|
if (! dir)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
|||||||
|
|
||||||
for (; iter != entries.end (); ++iter)
|
for (; iter != entries.end (); ++iter)
|
||||||
{
|
{
|
||||||
auto const sleNode = cachedRead(ledger, *iter );
|
auto const sleNode = ledger.read(keylet::child(*iter));
|
||||||
if (type == ltINVALID || sleNode->getType () == type)
|
if (type == ltINVALID || sleNode->getType () == type)
|
||||||
{
|
{
|
||||||
jvObjects.append (sleNode->getJson (0));
|
jvObjects.append (sleNode->getJson (0));
|
||||||
@@ -86,7 +86,7 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
dirIndex = getDirNodeIndex (rootDirIndex, nodeIndex);
|
dirIndex = getDirNodeIndex (rootDirIndex, nodeIndex);
|
||||||
dir = cachedRead(ledger, dirIndex, ltDIR_NODE);
|
dir = ledger.read({ltDIR_NODE, dirIndex});
|
||||||
if (! dir)
|
if (! dir)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -107,4 +107,3 @@ getAccountObjects (Ledger const& ledger, AccountID const& account,
|
|||||||
|
|
||||||
} // RPC
|
} // RPC
|
||||||
} // ripple
|
} // ripple
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace RPC {
|
|||||||
@param jvResult A JSON result that holds the request objects.
|
@param jvResult A JSON result that holds the request objects.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
getAccountObjects (Ledger const& ledger, AccountID const& account,
|
getAccountObjects (ReadView const& ledger, AccountID const& account,
|
||||||
LedgerEntryType const type, uint256 dirIndex, uint256 const& entryIndex,
|
LedgerEntryType const type, uint256 dirIndex, uint256 const& entryIndex,
|
||||||
std::uint32_t const limit, Json::Value& jvResult);
|
std::uint32_t const limit, Json::Value& jvResult);
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <BeastConfig.h>
|
#include <BeastConfig.h>
|
||||||
#include <ripple/rpc/impl/LookupLedger.h>
|
#include <ripple/rpc/impl/LookupLedger.h>
|
||||||
|
#include <ripple/ledger/View.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace RPC {
|
namespace RPC {
|
||||||
@@ -34,14 +35,14 @@ bool isValidatedOld (LedgerMaster& ledgerMaster)
|
|||||||
Tuning::maxValidatedLedgerAge;
|
Tuning::maxValidatedLedgerAge;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status ledgerFromRequest (Ledger::pointer& ledger, Context& context)
|
template <class T>
|
||||||
|
Status ledgerFromRequest (T& ledger, Context& context)
|
||||||
{
|
{
|
||||||
static auto const minSequenceGap = 10;
|
static auto const minSequenceGap = 10;
|
||||||
|
|
||||||
ledger.reset();
|
ledger.reset();
|
||||||
|
|
||||||
auto& params = context.params;
|
auto& params = context.params;
|
||||||
auto& netOps = context.netOps;
|
|
||||||
auto& ledgerMaster = context.ledgerMaster;
|
auto& ledgerMaster = context.ledgerMaster;
|
||||||
|
|
||||||
auto indexValue = params[jss::ledger_index];
|
auto indexValue = params[jss::ledger_index];
|
||||||
@@ -124,14 +125,12 @@ Status ledgerFromRequest (Ledger::pointer& ledger, Context& context)
|
|||||||
return {rpcNO_NETWORK, "InsufficientNetworkMode"};
|
return {rpcNO_NETWORK, "InsufficientNetworkMode"};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (ledger->isImmutable ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status::OK;
|
return Status::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValidated (LedgerMaster& ledgerMaster, Ledger& ledger)
|
bool isValidated (LedgerMaster& ledgerMaster, ReadView const& ledger)
|
||||||
{
|
{
|
||||||
if (ledger.info().validated)
|
if (ledger.info().validated)
|
||||||
return true;
|
return true;
|
||||||
@@ -146,7 +145,7 @@ bool isValidated (LedgerMaster& ledgerMaster, Ledger& ledger)
|
|||||||
// comes before the last validated ledger (and thus has been
|
// comes before the last validated ledger (and thus has been
|
||||||
// validated).
|
// validated).
|
||||||
auto hash = ledgerMaster.walkHashBySeq (seq);
|
auto hash = ledgerMaster.walkHashBySeq (seq);
|
||||||
if (ledger.getHash() != hash)
|
if (ledger.info().hash != hash)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (SHAMapMissingNode const&)
|
catch (SHAMapMissingNode const&)
|
||||||
@@ -157,7 +156,7 @@ bool isValidated (LedgerMaster& ledgerMaster, Ledger& ledger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mark ledger as validated to save time if we see it again.
|
// Mark ledger as validated to save time if we see it again.
|
||||||
ledger.setValidated();
|
ledger.info().validated = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,27 +181,62 @@ bool isValidated (LedgerMaster& ledgerMaster, Ledger& ledger)
|
|||||||
// return value. Otherwise, the object contains the field "validated" and
|
// return value. Otherwise, the object contains the field "validated" and
|
||||||
// optionally the fields "ledger_hash", "ledger_index" and
|
// optionally the fields "ledger_hash", "ledger_index" and
|
||||||
// "ledger_current_index", if they are defined.
|
// "ledger_current_index", if they are defined.
|
||||||
Status lookupLedger (
|
Status lookupLedgerDeprecated (
|
||||||
Ledger::pointer& ledger, Context& context, Json::Value& result)
|
Ledger::pointer& ledger, Context& context, Json::Value& result)
|
||||||
{
|
{
|
||||||
if (auto status = ledgerFromRequest (ledger, context))
|
if (auto status = ledgerFromRequest (ledger, context))
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (! ledger->info().open)
|
auto& info = ledger->info();
|
||||||
|
|
||||||
|
if (!info.open)
|
||||||
{
|
{
|
||||||
result[jss::ledger_hash] = to_string (ledger->getHash());
|
result[jss::ledger_hash] = to_string (info.hash);
|
||||||
result[jss::ledger_index] = ledger->info().seq;
|
result[jss::ledger_index] = info.seq;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result[jss::ledger_current_index] = ledger->info().seq;
|
result[jss::ledger_current_index] = info.seq;
|
||||||
|
}
|
||||||
|
|
||||||
|
result[jss::validated] = getApp().getLedgerMaster().isValidLedger(info);
|
||||||
|
return Status::OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status lookupLedger (
|
||||||
|
std::shared_ptr<ReadView const>& ledger, Context& context,
|
||||||
|
Json::Value& result)
|
||||||
|
{
|
||||||
|
if (auto status = ledgerFromRequest (ledger, context))
|
||||||
|
return status;
|
||||||
|
|
||||||
|
auto& info = ledger->info();
|
||||||
|
|
||||||
|
if (!info.open)
|
||||||
|
{
|
||||||
|
result[jss::ledger_hash] = to_string (info.hash);
|
||||||
|
result[jss::ledger_index] = info.seq;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result[jss::ledger_current_index] = info.seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
result[jss::validated] = isValidated (context.ledgerMaster, *ledger);
|
result[jss::validated] = isValidated (context.ledgerMaster, *ledger);
|
||||||
return Status::OK;
|
return Status::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value lookupLedger (Ledger::pointer& ledger, Context& context)
|
Json::Value lookupLedgerDeprecated (Ledger::pointer& ledger, Context& context)
|
||||||
|
{
|
||||||
|
Json::Value result;
|
||||||
|
if (auto status = lookupLedgerDeprecated (ledger, context, result))
|
||||||
|
status.inject (result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::Value lookupLedger (
|
||||||
|
std::shared_ptr<ReadView const>& ledger, Context& context)
|
||||||
{
|
{
|
||||||
Json::Value result;
|
Json::Value result;
|
||||||
if (auto status = lookupLedger (ledger, context, result))
|
if (auto status = lookupLedger (ledger, context, result))
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
#include <ripple/rpc/Status.h>
|
#include <ripple/rpc/Status.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
|
class ReadView;
|
||||||
|
|
||||||
namespace RPC {
|
namespace RPC {
|
||||||
|
|
||||||
class Context;
|
class Context;
|
||||||
@@ -33,14 +36,15 @@ class Context;
|
|||||||
If there is no error in the return value, then the ledger pointer will have
|
If there is no error in the return value, then the ledger pointer will have
|
||||||
been filled.
|
been filled.
|
||||||
*/
|
*/
|
||||||
Json::Value lookupLedger (Ledger::pointer&, Context&);
|
Json::Value lookupLedgerDeprecated (Ledger::pointer&, Context&);
|
||||||
|
Json::Value lookupLedger (std::shared_ptr<ReadView const>&, Context&);
|
||||||
|
|
||||||
/** Look up a ledger from a request and fill a Json::Result with the data
|
/** Look up a ledger from a request and fill a Json::Result with the data
|
||||||
representing a ledger.
|
representing a ledger.
|
||||||
|
|
||||||
If the returned Status is OK, the ledger pointer will have been filled. */
|
If the returned Status is OK, the ledger pointer will have been filled. */
|
||||||
Status lookupLedger (
|
Status lookupLedger (
|
||||||
Ledger::pointer&, Context&, Json::Value& result);
|
std::shared_ptr<ReadView const>&, Context&, Json::Value& result);
|
||||||
|
|
||||||
} // RPC
|
} // RPC
|
||||||
} // ripple
|
} // ripple
|
||||||
|
|||||||
Reference in New Issue
Block a user