mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
Add a facility in TrustSet to clear a RippleState to self.
This commit is contained in:
@@ -67,11 +67,22 @@ TER TrustSetTransactor::doApply()
|
||||
}
|
||||
|
||||
if (mTxnAccountID == uDstAccountID)
|
||||
{
|
||||
SLE::pointer selDelete = mEngine->entryCache(ltRIPPLE_STATE, Ledger::getRippleStateIndex(mTxnAccountID, uDstAccountID, uCurrencyID));
|
||||
|
||||
if (selDelete)
|
||||
{
|
||||
cLog(lsWARNING) << "doTrustSet: Clearing redundant line.";
|
||||
|
||||
return mEngine->getNodes().trustDelete(selDelete, mTxnAccountID, uDstAccountID);
|
||||
}
|
||||
else
|
||||
{
|
||||
cLog(lsINFO) << "doTrustSet: Malformed transaction: Can not extend credit to self.";
|
||||
|
||||
return temDST_IS_SRC;
|
||||
}
|
||||
}
|
||||
|
||||
SLE::pointer sleDst = mEngine->entryCache(ltACCOUNT_ROOT, Ledger::getAccountRootIndex(uDstAccountID));
|
||||
if (!sleDst)
|
||||
|
||||
Reference in New Issue
Block a user