-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore_default option on account_lines #3980
Conversation
@nbougalis FYI. This would help reduce the data fetched for all XUMM users significantly on "mixed accounts" (issuing and holding) like we see a lot of these days. |
@manojsdoshi I'm proposing this for inclusion into 1.8.0-rc3, since it helps reduce the load for Xumm (and the server). |
@manojsdoshi @nbougalis What's the status on this? |
bool ignore = false; | ||
if (visitData.ignoreDefault) | ||
{ | ||
if (sleCur->getFieldAmount(sfLowLimit).getIssuer() == | ||
visitData.accountID) | ||
ignore = | ||
!(sleCur->getFieldU32(sfFlags) & lsfLowReserve); | ||
else | ||
ignore = !( | ||
sleCur->getFieldU32(sfFlags) & lsfHighReserve); | ||
} | ||
|
||
auto const line = | ||
RippleState::makeItem(visitData.accountID, sleCur); | ||
if (line != nullptr && | ||
(!visitData.hasPeer || | ||
visitData.raPeerAccount == line->getAccountIDPeer())) | ||
{ | ||
visitData.items.emplace_back(line); | ||
if (!ignore) | ||
visitData.items.emplace_back(line); | ||
|
||
visitData.lastFound = line; | ||
visitData.foundCount++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be somewhat more readable if ignore
was include
. So it would look something like:
bool include = true;
if (visitData.ignoreDefault)
{
if (sleCur->getFieldAmount(sfLowLimit).getIssuer() ==
visitData.accountID)
include = sleCur->getFieldU32(sfFlags) & lsfLowReserve;
else
ignore = sleCur->getFieldU32(sfFlags) & lsfHighReserve;
}
[...]
{
if (include)
visitData.items.emplace_back(line);
[...]
High Level Overview of Change
Add
ignore_default
flag toaccount_lines
. This flag suppresses the output of incoming trustlines in default state.Context of Change
Users of XUMM often have unwanted incoming trustlines in default state, these are not useful in the vast majority of cases. Ability to suppress these in
account_lines
saves bandwidth and resources.Type of Change