本文整理汇总了C++中ledger::pointer类的典型用法代码示例。如果您正苦于以下问题:C++ pointer类的具体用法?C++ pointer怎么用?C++ pointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getledgerhash
ledgerhash getledgerhash(ledger::pointer ledger, ledgerindex index)
{
ledgerhash hash;
try
{
hash = ledger->getledgerhash(index);
}
catch (shamapmissingnode &)
{
m_journal.warning <<
"node missing from ledger " << ledger->getledgerseq();
getapp().getinboundledgers().findcreate (
ledger->gethash(), ledger->getledgerseq(), inboundledger::fcgeneric);
}
return hash;
}
示例2: gethash
/** returns the hash of the specified ledger.
@param ledgerindex the index of the desired ledger.
@param referenceledger [out] an optional known good subsequent ledger.
@return the hash of the ledger. this will be all-bits-zero if not found.
*/
ledgerhash gethash(
ledgerindex const& ledgerindex,
ledger::pointer& referenceledger)
{
ledgerhash ledgerhash;
if (!referenceledger || (referenceledger->getledgerseq() < ledgerindex))
{
referenceledger = getapp().getledgermaster().getvalidatedledger();
if (!referenceledger)
{
m_journal.warning << "no validated ledger";
return ledgerhash; // nothing we can do. no validated ledger.
}
}
if (referenceledger->getledgerseq() >= ledgerindex)
{
// see if the hash for the ledger we need is in the reference ledger
ledgerhash = getledgerhash(referenceledger, ledgerindex);
if (ledgerhash.iszero())
{
// no, try to get another ledger that might have the hash we need
// compute the index and hash of a ledger that will have the hash we need
ledgerindex refindex = (ledgerindex + 255) & (~255);
ledgerhash refhash = getledgerhash (referenceledger, refindex);
bool const nonzero (refhash.isnonzero ());
assert (nonzero);
if (nonzero)
{
// we found the hash and sequence of a better reference ledger
referenceledger = getapp().getledgermaster().findacquireledger (refindex, refhash);
if (referenceledger)
ledgerhash = getledgerhash(referenceledger, ledgerindex);
}
}
}
else
m_journal.warning << "validated ledger is prior to target ledger";
return ledgerhash;
}
示例3: asyncAccept
void LedgerMaster::asyncAccept(Ledger::pointer ledger)
{
uint32 seq = ledger->getLedgerSeq();
uint256 prevHash = ledger->getParentHash();
while (seq > 0)
{
{
boost::recursive_mutex::scoped_lock ml(mLock);
mCompleteLedgers.setValue(seq);
--seq;
if (mCompleteLedgers.hasValue(seq))
break;
}
uint256 tHash, pHash;
if (!Ledger::getHashesByIndex(seq, tHash, pHash) || (tHash != prevHash))
break;
prevHash = pHash;
}
resumeAcquiring();
}
示例4: runtime_error
SLE::pointer
getLedgerEntryRippleState(Ledger::pointer ledger,
TestAccount const& account1, TestAccount const& account2,
Currency currency)
{
auto uNodeIndex = getRippleStateIndex(
account1.pk.getAccountID(), account2.pk.getAccountID(),
to_currency(currency.getCurrency()));
if (!uNodeIndex.isNonZero())
throw std::runtime_error(
"!uNodeIndex.isNonZero()");
return ledger->getSLEi(uNodeIndex);
}
示例5: doLedger
/** Process a single ledger
@param ledgerIndex The index of the ledger to process.
@param ledgerHash The known correct hash of the ledger.
@param doNodes Ensure all ledger nodes are in the node db.
@param doTxns Reprocess (account) transactions to SQL databases.
@return `true` if the ledger was cleaned.
*/
bool doLedger(
LedgerIndex const& ledgerIndex,
LedgerHash const& ledgerHash,
bool doNodes,
bool doTxns)
{
Ledger::pointer nodeLedger =
getApp().getInboundLedgers().acquire (
ledgerHash, ledgerIndex, InboundLedger::fcGENERIC);
if (!nodeLedger)
{
m_journal.debug << "Ledger " << ledgerIndex << " not available";
return false;
}
Ledger::pointer dbLedger = Ledger::loadByIndex(ledgerIndex);
if (! dbLedger ||
(dbLedger->getHash() != ledgerHash) ||
(dbLedger->getParentHash() != nodeLedger->getParentHash()))
{
// Ideally we'd also check for more than one ledger with that index
m_journal.debug <<
"Ledger " << ledgerIndex << " mismatches SQL DB";
doTxns = true;
}
if(! getApp().getLedgerMaster().fixIndex(ledgerIndex, ledgerHash))
{
m_journal.debug << "ledger " << ledgerIndex << " had wrong entry in history";
doTxns = true;
}
if (doNodes && !nodeLedger->walkLedger())
{
m_journal.debug << "Ledger " << ledgerIndex << " is missing nodes";
getApp().getInboundLedgers().acquire(
ledgerHash, ledgerIndex, InboundLedger::fcGENERIC);
return false;
}
if (doTxns && !nodeLedger->pendSaveValidated(true, false))
{
m_journal.debug << "Failed to save ledger " << ledgerIndex;
return false;
}
return true;
}
示例6: lookupLedgerDeprecated
// The previous version of the lookupLedger command would accept the
// "ledger_index" argument as a string and silently treat it as a request to
// return the current ledger which, while not strictly wrong, could cause a lot
// of confusion.
//
// The code now robustly validates the input and ensures that the only possible
// values for the "ledger_index" parameter are the index of a ledger passed as
// an integer or one of the strings "current", "closed" or "validated".
// Additionally, the code ensures that the value passed in "ledger_hash" is a
// string and a valid hash. Invalid values will return an appropriate error
// code.
//
// In the absence of the "ledger_hash" or "ledger_index" parameters, the code
// assumes that "ledger_index" has the value "current".
//
// Returns a Json::objectValue. If there was an error, it will be in that
// return value. Otherwise, the object contains the field "validated" and
// optionally the fields "ledger_hash", "ledger_index" and
// "ledger_current_index", if they are defined.
Status lookupLedgerDeprecated (
Ledger::pointer& 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] = getApp().getLedgerMaster().isValidLedger(info);
return Status::OK;
}
示例7: getLineCache
/** Get the current RippleLineCache, updating it if necessary.
Get the correct ledger to use.
*/
RippleLineCache::pointer PathRequests::getLineCache (Ledger::pointer& ledger, bool authoritative)
{
ScopedLockType sl (mLock, __FILE__, __LINE__);
uint32 lineSeq = mLineCache ? mLineCache->getLedger()->getLedgerSeq() : 0;
uint32 lgrSeq = ledger->getLedgerSeq();
if ( (lineSeq == 0) || // no ledger
(authoritative && (lgrSeq > lineSeq)) || // newer authoritative ledger
(authoritative && ((lgrSeq + 8) < lineSeq)) || // we jumped way back for some reason
(lgrSeq > (lineSeq + 8))) // we jumped way forward for some reason
{
ledger = boost::make_shared<Ledger>(*ledger, false); // Take a snapshot of the ledger
mLineCache = boost::make_shared<RippleLineCache> (ledger);
}
else
{
ledger = mLineCache->getLedger();
}
return mLineCache;
}
示例8: autofill_fee
/** Fill in the fee on behalf of the client.
This is called when the client does not explicitly specify the fee.
The client may also put a ceiling on the amount of the fee. This ceiling
is expressed as a multiplier based on the current ledger's fee schedule.
JSON fields
"Fee" The fee paid by the transaction. Omitted when the client
wants the fee filled in.
"fee_mult_max" A multiplier applied to the current ledger's transaction
fee that caps the maximum the fee server should auto fill.
If this optional field is not specified, then a default
multiplier is used.
@param tx The JSON corresponding to the transaction to fill in
@param ledger A ledger for retrieving the current fee schedule
@param result A JSON object for injecting error results, if any
@param admin `true` if this is called by an administrative endpoint.
*/
static void autofill_fee (Json::Value& request,
Ledger::pointer ledger, Json::Value& result, bool admin)
{
Json::Value& tx (request["tx_json"]);
if (tx.isMember ("Fee"))
return;
int mult = DEFAULT_AUTO_FILL_FEE_MULTIPLIER;
if (request.isMember ("fee_mult_max"))
{
if (request["fee_mult_max"].isNumeric ())
{
mult = request["fee_mult_max"].asInt();
}
else
{
RPC::inject_error (rpcHIGH_FEE, RPC::expected_field_message (
"fee_mult_max", "a number"), result);
return;
}
}
std::uint64_t const feeDefault = getConfig().FEE_DEFAULT;
// Administrative endpoints are exempt from local fees
std::uint64_t const fee = ledger->scaleFeeLoad (feeDefault, admin);
std::uint64_t const limit = mult * feeDefault;
if (fee > limit)
{
std::stringstream ss;
ss <<
"Fee of " << fee <<
" exceeds the requested tx limit of " << limit;
RPC::inject_error (rpcHIGH_FEE, ss.str(), result);
return;
}
tx ["Fee"] = static_cast<int>(fee);
}
示例9: update
void OrderBookDB::update (Ledger::pointer ledger)
{
hash_set< uint256 > seen;
OrderBookDB::IssueToOrderBook destMap;
OrderBookDB::IssueToOrderBook sourceMap;
hash_set< Issue > XDVBooks;
WriteLog (lsDEBUG, OrderBookDB) << "OrderBookDB::update>";
// walk through the entire ledger looking for orderbook entries
int books = 0;
try
{
ledger->visitStateItems(std::bind(&updateHelper, std::placeholders::_1,
std::ref(seen), std::ref(destMap),
std::ref(sourceMap), std::ref(XDVBooks), std::ref(books)));
}
catch (const SHAMapMissingNode&)
{
WriteLog (lsINFO, OrderBookDB)
<< "OrderBookDB::update encountered a missing node";
ScopedLockType sl (mLock);
mSeq = 0;
return;
}
WriteLog (lsDEBUG, OrderBookDB)
<< "OrderBookDB::update< " << books << " books found";
{
ScopedLockType sl (mLock);
mXDVBooks.swap(XDVBooks);
mSourceMap.swap(sourceMap);
mDestMap.swap(destMap);
}
getApp().getLedgerMaster().newOrderBookDB();
}
示例10: getLedgerByHash
Ledger::pointer LedgerHistory::getLedgerByHash (uint256 const& hash)
{
Ledger::pointer ret = m_ledgers_by_hash.fetch (hash);
if (ret)
{
assert (ret->isImmutable ());
assert (ret->getHash () == hash);
return ret;
}
ret = Ledger::loadByHash (hash);
if (!ret)
return ret;
assert (ret->isImmutable ());
assert (ret->getHash () == hash);
m_ledgers_by_hash.canonicalize (ret->getHash (), ret);
assert (ret->getHash () == hash);
return ret;
}
示例11: in
/**
* Instantiate an application and replay a ledger history out
* of the dump file `filename`.
*/
void
LedgerDump::loadTransactions (std::string const& filename)
{
std::ifstream in (filename);
require ((bool)in, "opening file");
std::unique_ptr <Application> app (make_Application ());
app->setup ();
auto &lm = app->getLedgerMaster ();
WriteLog (lsINFO, LedgerDump) << "Loading ledgers from " << filename;
auto nTxs = 0;
// app->setup() when called with START_UP == Config::FRESH calls
// ApplicationImp::startNewLedger(). Unfortunately it starts the new
// ledger at the wrong timestamp, so we call it again once we've read
// the first ledger we're going to apply. However, it's worth
// understanding that startNewLedger() establishes 3 ledgers:
//
// Ledger 0 is the genesis ledger, it's not a real ledger, just a
// number.
//
// Ledger 1 is the root-account deposit ledger, with a single pile of
// currency owned by a single account generated by the seed
// "masterpassword".
//
// Ledger 2 is created and closed immediately on start, not sure why.
//
// Ledger 3 is a new ledger chained to #2 and left open in
// ledgermaster.
//
// Ledger 3 is where replay should be starting, so (once we call
// startNewLedger() again) we pull out ledger #2 and use it as the
// parent of the new ledger 3 we're replaying, and throw away the #3
// that was made by startNewLedger().
Ledger::pointer parentLedger;
while (in)
{
if ((gLedgerSeq & 0xfff) == 0) {
Job j;
app->doSweep (j);
}
Json::Value j = loadJsonRecord (in);
Ledger::pointer deserializedLedger;
SHAMap::pointer txSet;
std::vector<uint256> txOrder;
std::tie (deserializedLedger, txSet, txOrder) =
loadLedgerAndTransactionsFromJSON (*app, j);
if (!parentLedger)
{
if (getConfig ().START_LEDGER.empty ())
{
require (deserializedLedger->getLedgerSeq () == 3,
"Initial ledger isn't seq #3");
// On first iteration, restart the app's view of the ledger
// history at the same instant as the parent close time of the
// first ledger (ledger #3).
app->startNewLedger (deserializedLedger->getParentCloseTimeNC ());
parentLedger = lm.getClosedLedger ();
require (parentLedger->getLedgerSeq () == 2,
"Initial ledger parent isn't seq #2");
}
else
{
// We're being invoked with --ledger, which is where we
// will start replay from.
require (app->loadOldLedger (getConfig ().START_LEDGER, false),
"Reloading old ledger failed.");
parentLedger = lm.getClosedLedger ();
}
auto const parentSeq = parentLedger->getLedgerSeq ();
auto seq = j["seq"].asUInt ();
while (parentSeq + 1 > seq)
{
// Fast-scan JSON records until we hit the right one.
WriteLog (lsINFO, LedgerDump) << "scanning past ledger: "
<< seq;
j = loadJsonRecord (in);
seq = j["seq"].asUInt ();
if (parentSeq + 1 <= seq)
{
require (parentSeq + 1 == seq,
"Missing ledgers between loaded and replay-start");
std::tie (deserializedLedger, txSet, txOrder) =
loadLedgerAndTransactionsFromJSON (*app, j);
}
}
gLedgerSeq = parentSeq;
require(parentLedger->getLedgerSeq () + 1 ==
//.........这里部分代码省略.........
示例12: main
int main (){
std::string db_name = "/home/ivanzjj/radix_tree";
RocksdbInstance::set_db_name (db_name);
Ledger::pointer ledger = std::make_shared <Ledger> ();
std::string db_name2 = "/home/ivanzjj/ledger.db";
SqliteInstance::set_db_name (db_name2);
uint256 hash;
char hash_ch[32];
for (int i=0;i<32;i++)
hash_ch[i] = i;
hash.init (hash_ch);
hash.to_string ();
Serializer ss;
char ch[100];
for (int i=0;i<100;i++) ch[i] = i;
ss.add_raw (ch, 100);
if (!ledger->add_account_tree_entry (hash, ss)){
printf ("add_account_tree_entry error!\n");
return 1;
}
// dfs (ledger->get_account_tree ()->get_root (), 0);
for (int i = 0; i < 32; i++){
hash_ch[i] = i;
}
hash_ch[0] = 1;
hash.init (hash_ch);
hash.to_string ();
if (!ledger->add_account_tree_entry (hash, ss)){
printf ("add_account_tree_entry error2\n");
return 1;
}
// dfs (ledger->get_account_tree ()->get_root (), 0);
for (int i = 0; i < 32; i++) hash_ch[i] = i;
hash_ch[0] = 1;
hash_ch[1] = 2;
hash.init (hash_ch);
hash.to_string ();
if (!ledger->add_account_tree_entry (hash, ss)){
printf ("add_account_tree_entry error2\n");
return 1;
}
// dfs (ledger->get_account_tree ()->get_root (), 0);
for (int i = 0; i < 32; i++){
hash_ch[i] = i;
}
hash.init (hash_ch);
if (ledger->has_account (hash)){
hash.to_string ();
printf ("YES\n");
ch[0] = 10;
ss.peek_data ().clear();
ss.add_raw (ch, 100);
RadixMerkleTreeLeaf::pointer new_item = std::make_shared<RadixMerkleTreeLeaf> (hash, ss);
if (!ledger->update_account_tree_entry (new_item)){
printf ("update_account_tree_entry error!\n");
return 1;
}
}
else {
printf ("NO\n");
}
// dfs (ledger->get_account_tree ()->get_root (), 0);
return 0;
}
示例13: doAccountOffers
// {
// account: <account>|<account_public_key>
// account_index: <number> // optional, defaults to 0.
// ledger_hash : <ledger>
// ledger_index : <ledger_index>
// limit: integer // optional
// marker: opaque // optional, resume previous query
// }
Json::Value doAccountOffers (RPC::Context& context)
{
auto const& params (context.params);
if (! params.isMember (jss::account))
return RPC::missing_field_error (jss::account);
Ledger::pointer ledger;
Json::Value result (RPC::lookupLedger (params, ledger, context.netOps));
if (! ledger)
return result;
std::string strIdent (params[jss::account].asString ());
bool bIndex (params.isMember (jss::account_index));
int const iIndex (bIndex ? params[jss::account_index].asUInt () : 0);
DivvyAddress divvyAddress;
Json::Value const jv = RPC::accountFromString (
divvyAddress, bIndex, strIdent, iIndex, false);
if (! jv.empty ())
{
for (Json::Value::const_iterator it (jv.begin ()); it != jv.end (); ++it)
result[it.memberName ()] = it.key ();
return result;
}
// Get info on account.
result[jss::account] = divvyAddress.humanAccountID ();
if (bIndex)
result[jss::account_index] = iIndex;
if (! ledger->exists(getAccountRootIndex(
divvyAddress.getAccountID())))
return rpcError (rpcACT_NOT_FOUND);
unsigned int limit;
if (params.isMember (jss::limit))
{
auto const& jvLimit (params[jss::limit]);
if (! jvLimit.isIntegral ())
return RPC::expected_field_error (jss::limit, "unsigned integer");
limit = jvLimit.isUInt () ? jvLimit.asUInt () :
std::max (0, jvLimit.asInt ());
if (context.role != Role::ADMIN)
{
limit = std::max (RPC::Tuning::minOffersPerRequest,
std::min (limit, RPC::Tuning::maxOffersPerRequest));
}
}
else
{
limit = RPC::Tuning::defaultOffersPerRequest;
}
AccountID const& raAccount (divvyAddress.getAccountID ());
Json::Value& jsonOffers (result[jss::offers] = Json::arrayValue);
std::vector <std::shared_ptr<SLE const>> offers;
unsigned int reserve (limit);
uint256 startAfter;
std::uint64_t startHint;
if (params.isMember(jss::marker))
{
// We have a start point. Use limit - 1 from the result and use the
// very last one for the resume.
Json::Value const& marker (params[jss::marker]);
if (! marker.isString ())
return RPC::expected_field_error (jss::marker, "string");
startAfter.SetHex (marker.asString ());
auto const sleOffer = fetch (*ledger, startAfter,
getApp().getSLECache());
if (sleOffer == nullptr ||
sleOffer->getType () != ltOFFER ||
raAccount != sleOffer->getFieldAccount160 (sfAccount))
{
return rpcError (rpcINVALID_PARAMS);
}
startHint = sleOffer->getFieldU64(sfOwnerNode);
// Caller provided the first offer (startAfter), add it as first result
Json::Value& obj (jsonOffers.append (Json::objectValue));
sleOffer->getFieldAmount (sfTakerPays).setJson (obj[jss::taker_pays]);
sleOffer->getFieldAmount (sfTakerGets).setJson (obj[jss::taker_gets]);
obj[jss::seq] = sleOffer->getFieldU32 (sfSequence);
obj[jss::flags] = sleOffer->getFieldU32 (sfFlags);
//.........这里部分代码省略.........
示例14: handleMismatch
void LedgerHistory::handleMismatch (LedgerHash const& built, LedgerHash const& valid)
{
assert (built != valid);
++mismatch_counter_;
Ledger::pointer builtLedger = getLedgerByHash (built);
Ledger::pointer validLedger = getLedgerByHash (valid);
if (builtLedger && validLedger)
{
assert (builtLedger->getLedgerSeq() == validLedger->getLedgerSeq());
// Determine the mismatch reason
// Distinguish Byzantine failure from transaction processing difference
if (builtLedger->getParentHash() != validLedger->getParentHash())
{
// Disagreement over prior ledger indicates sync issue
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on prior ledger";
}
else if (builtLedger->getCloseTimeNC() != validLedger->getCloseTimeNC())
{
// Disagreement over close time indicates Byzantine failure
WriteLog (lsERROR, LedgerMaster) << "MISMATCH on close time";
}
else
{
std::vector <uint256> builtTx, validTx;
builtLedger->peekTransactionMap()->visitLeaves(
std::bind (&addLeaf, std::ref (builtTx), std::placeholders::_1));
validLedger->peekTransactionMap()->visitLeaves(
std::bind (&addLeaf, std::ref (validTx), std::placeholders::_1));
std::sort (builtTx.begin(), builtTx.end());
std::sort (validTx.begin(), validTx.end());
if (builtTx == validTx)
{
// Disagreement with same prior ledger, close time, and transactions
// indicates a transaction processing difference
WriteLog (lsERROR, LedgerMaster) <<
"MISMATCH with same " << builtTx.size() << " tx";
}
else
{
std::vector <uint256> notBuilt, notValid;
std::set_difference (
validTx.begin(), validTx.end(),
builtTx.begin(), builtTx.end(),
std::inserter (notBuilt, notBuilt.begin()));
std::set_difference (
builtTx.begin(), builtTx.end(),
validTx.begin(), validTx.end(),
std::inserter (notValid, notValid.begin()));
// This can be either a disagreement over the consensus
// set or difference in which transactions were rejected
// as invalid
WriteLog (lsERROR, LedgerMaster) << "MISMATCH tx differ "
<< builtTx.size() << " built, " << validTx.size() << " valid";
for (auto const& t : notBuilt)
{
WriteLog (lsERROR, LedgerMaster) << "MISMATCH built without " << t;
}
for (auto const& t : notValid)
{
WriteLog (lsERROR, LedgerMaster) << "MISMATCH valid without " << t;
}
}
}
}
else
WriteLog (lsERROR, LedgerMaster) << "MISMATCH cannot be analyzed";
}
示例15: doAccountTxOld
// {
// account: account,
// ledger_index_min: ledger_index,
// ledger_index_max: ledger_index,
// binary: boolean, // optional, defaults to false
// count: boolean, // optional, defaults to false
// descending: boolean, // optional, defaults to false
// offset: integer, // optional, defaults to 0
// limit: integer // optional
// }
Json::Value doAccountTxOld (RPC::Context& context)
{
RippleAddress raAccount;
std::uint32_t offset
= context.params_.isMember ("offset")
? context.params_["offset"].asUInt () : 0;
int limit = context.params_.isMember ("limit")
? context.params_["limit"].asUInt () : -1;
bool bBinary = context.params_.isMember ("binary")
&& context.params_["binary"].asBool ();
bool bDescending = context.params_.isMember ("descending")
&& context.params_["descending"].asBool ();
bool bCount = context.params_.isMember ("count")
&& context.params_["count"].asBool ();
std::uint32_t uLedgerMin;
std::uint32_t uLedgerMax;
std::uint32_t uValidatedMin;
std::uint32_t uValidatedMax;
bool bValidated = context.netOps_.getValidatedRange (
uValidatedMin, uValidatedMax);
if (!context.params_.isMember ("account"))
return rpcError (rpcINVALID_PARAMS);
if (!raAccount.setAccountID (context.params_["account"].asString ()))
return rpcError (rpcACT_MALFORMED);
if (offset > 3000)
return rpcError (rpcATX_DEPRECATED);
context.loadType_ = Resource::feeHighBurdenRPC;
// DEPRECATED
if (context.params_.isMember ("ledger_min"))
{
context.params_["ledger_index_min"] = context.params_["ledger_min"];
bDescending = true;
}
// DEPRECATED
if (context.params_.isMember ("ledger_max"))
{
context.params_["ledger_index_max"] = context.params_["ledger_max"];
bDescending = true;
}
if (context.params_.isMember ("ledger_index_min")
|| context.params_.isMember ("ledger_index_max"))
{
std::int64_t iLedgerMin = context.params_.isMember ("ledger_index_min")
? context.params_["ledger_index_min"].asInt () : -1;
std::int64_t iLedgerMax = context.params_.isMember ("ledger_index_max")
? context.params_["ledger_index_max"].asInt () : -1;
if (!bValidated && (iLedgerMin == -1 || iLedgerMax == -1))
{
// Don't have a validated ledger range.
return rpcError (rpcLGR_IDXS_INVALID);
}
uLedgerMin = iLedgerMin == -1 ? uValidatedMin : iLedgerMin;
uLedgerMax = iLedgerMax == -1 ? uValidatedMax : iLedgerMax;
if (uLedgerMax < uLedgerMin)
{
return rpcError (rpcLGR_IDXS_INVALID);
}
}
else
{
Ledger::pointer l;
Json::Value ret = RPC::lookupLedger (context.params_, l, context.netOps_);
if (!l)
return ret;
uLedgerMin = uLedgerMax = l->getLedgerSeq ();
}
int count = 0;
#ifndef BEAST_DEBUG
try
{
#endif
Json::Value ret (Json::objectValue);
ret["account"] = raAccount.humanAccountID ();
//.........这里部分代码省略.........