mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add deletion_blockers_only param to account_objects RPC command
This commit is contained in:
committed by
Manoj doshi
parent
fccb7e1c70
commit
7e7664c29a
@@ -82,8 +82,8 @@ accountFromString(
|
||||
|
||||
bool
|
||||
getAccountObjects(ReadView const& ledger, AccountID const& account,
|
||||
LedgerEntryType const type, uint256 dirIndex, uint256 const& entryIndex,
|
||||
std::uint32_t const limit, Json::Value& jvResult)
|
||||
boost::optional<std::vector<LedgerEntryType>> const& typeFilter, uint256 dirIndex,
|
||||
uint256 const& entryIndex, std::uint32_t const limit, Json::Value& jvResult)
|
||||
{
|
||||
auto const rootDirIndex = getOwnerDirIndex (account);
|
||||
auto found = false;
|
||||
@@ -117,7 +117,18 @@ getAccountObjects(ReadView const& ledger, AccountID const& account,
|
||||
for (; iter != entries.end (); ++iter)
|
||||
{
|
||||
auto const sleNode = ledger.read(keylet::child(*iter));
|
||||
if (type == ltINVALID || sleNode->getType () == type)
|
||||
|
||||
auto typeMatchesFilter = [] (
|
||||
std::vector<LedgerEntryType> const& typeFilter,
|
||||
LedgerEntryType ledgerType)
|
||||
{
|
||||
auto it = std::find(typeFilter.begin(), typeFilter.end(),
|
||||
ledgerType);
|
||||
return it != typeFilter.end();
|
||||
};
|
||||
|
||||
if (!typeFilter.has_value() ||
|
||||
typeMatchesFilter(typeFilter.value(), sleNode->getType()))
|
||||
{
|
||||
jvObjects.append (sleNode->getJson (JsonOptions::none));
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ accountFromString (AccountID& result, std::string const& strIdent,
|
||||
/** Gathers all objects for an account in a ledger.
|
||||
@param ledger Ledger to search account objects.
|
||||
@param account AccountID to find objects for.
|
||||
@param type Gathers objects of this type. ltINVALID gathers all types.
|
||||
@param typeFilter Gathers objects of these types. empty gathers all types.
|
||||
@param dirIndex Begin gathering account objects from this directory.
|
||||
@param entryIndex Begin gathering objects from this directory node.
|
||||
@param limit Maximum number of objects to find.
|
||||
@@ -63,8 +63,8 @@ accountFromString (AccountID& result, std::string const& strIdent,
|
||||
*/
|
||||
bool
|
||||
getAccountObjects (ReadView const& ledger, AccountID const& account,
|
||||
LedgerEntryType const type, uint256 dirIndex, uint256 const& entryIndex,
|
||||
std::uint32_t const limit, Json::Value& jvResult);
|
||||
boost::optional<std::vector<LedgerEntryType>> const& typeFilter, uint256 dirIndex,
|
||||
uint256 const& entryIndex, std::uint32_t const limit, Json::Value& jvResult);
|
||||
|
||||
/** Look up a ledger from a request and fill a Json::Result with either
|
||||
an error, or data representing a ledger.
|
||||
|
||||
Reference in New Issue
Block a user