mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add trust auto clear. Fixes #28
This commit is contained in:
@@ -252,22 +252,7 @@ TER TrustSetTransactor::doApply()
|
||||
{
|
||||
// Can delete.
|
||||
|
||||
bool bLowNode = sleRippleState->isFieldPresent(sfLowNode); // Detect legacy dirs.
|
||||
bool bHighNode = sleRippleState->isFieldPresent(sfHighNode);
|
||||
uint64 uLowNode = sleRippleState->getFieldU64(sfLowNode);
|
||||
uint64 uHighNode = sleRippleState->getFieldU64(sfHighNode);
|
||||
|
||||
cLog(lsTRACE) << "doTrustSet: Deleting ripple line: low";
|
||||
terResult = mEngine->getNodes().dirDelete(false, uLowNode, Ledger::getOwnerDirIndex(uLowAccountID), sleRippleState->getIndex(), false, !bLowNode);
|
||||
|
||||
if (tesSUCCESS == terResult)
|
||||
{
|
||||
cLog(lsTRACE) << "doTrustSet: Deleting ripple line: high";
|
||||
terResult = mEngine->getNodes().dirDelete(false, uHighNode, Ledger::getOwnerDirIndex(uHighAccountID), sleRippleState->getIndex(), false, !bHighNode);
|
||||
}
|
||||
|
||||
cLog(lsINFO) << "doTrustSet: Deleting ripple line: state";
|
||||
mEngine->entryDelete(sleRippleState);
|
||||
terResult = mEngine->getNodes().trustDelete(sleRippleState, uLowAccountID, uHighAccountID);
|
||||
}
|
||||
else if (bReserveIncrease
|
||||
&& mPriorBalance.getNValue() < uReserveCreate) // Reserve is not scaled by load.
|
||||
|
||||
Reference in New Issue
Block a user