mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 06:25:51 +00:00
Add support for incrementally updating owner count.
This commit is contained in:
@@ -53,7 +53,12 @@ TER TrustSetTransactor::doApply()
|
||||
if (sleRippleState)
|
||||
{
|
||||
// A line exists in one or more directions.
|
||||
|
||||
#if 0
|
||||
// We might delete a ripple state node if everything is set to defaults.
|
||||
// However, this is problematic as it may make predicting reserve amounts harder for users.
|
||||
// The code here is incomplete.
|
||||
|
||||
if (!saLimitAmount)
|
||||
{
|
||||
// Zeroing line.
|
||||
@@ -135,7 +140,7 @@ TER TrustSetTransactor::doApply()
|
||||
if (uQualityOut)
|
||||
sleRippleState->setFieldU32(bFlipped ? sfHighQualityOut : sfLowQualityOut, uQualityOut);
|
||||
|
||||
uint64 uSrcRef; // Ignored, dirs never delete.
|
||||
uint64 uSrcRef; // <-- Ignored, dirs never delete.
|
||||
|
||||
terResult = mEngine->getNodes().dirAdd(
|
||||
uSrcRef,
|
||||
@@ -143,12 +148,18 @@ TER TrustSetTransactor::doApply()
|
||||
sleRippleState->getIndex(),
|
||||
boost::bind(&Ledger::ownerDirDescriber, _1, mTxnAccountID));
|
||||
|
||||
if (tesSUCCESS == terResult)
|
||||
terResult = mEngine->getNodes().ownerCountAdjust(mTxnAccountID, 1, mTxnAccount);
|
||||
|
||||
if (tesSUCCESS == terResult)
|
||||
terResult = mEngine->getNodes().dirAdd(
|
||||
uSrcRef,
|
||||
Ledger::getOwnerDirIndex(uDstAccountID),
|
||||
sleRippleState->getIndex(),
|
||||
boost::bind(&Ledger::ownerDirDescriber, _1, uDstAccountID));
|
||||
|
||||
if (tesSUCCESS == terResult)
|
||||
terResult = mEngine->getNodes().ownerCountAdjust(uDstAccountID, 1, sleDst);
|
||||
}
|
||||
|
||||
Log(lsINFO) << "doTrustSet<";
|
||||
|
||||
Reference in New Issue
Block a user