mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 06:10:58 +00:00
Use deferred credits in XRPEndpointStep:
The XRPEndpointStep bypassed the logic in deferred credits and incorrectly counted funds acquired during a payment as available for use in the payment. It also incorrectly used the current ownerCount when calculating the reserve instead of the owner count as it was at the beginning of the payment (reducing the owner count is analogous to acquiring funds during a payment.)
This commit is contained in:
@@ -139,15 +139,8 @@ static
|
||||
XRPAmount
|
||||
xrpLiquid (ReadView& sb, AccountID const& src)
|
||||
{
|
||||
if (auto sle = sb.read (keylet::account (src)))
|
||||
{
|
||||
auto const reserve = sb.fees ().accountReserve ((*sle)[sfOwnerCount]);
|
||||
auto const balance = (*sle)[sfBalance].xrp ();
|
||||
if (balance < reserve)
|
||||
return XRPAmount (beast::zero);
|
||||
return balance - reserve;
|
||||
}
|
||||
return XRPAmount (beast::zero);
|
||||
return accountHolds(
|
||||
sb, src, xrpCurrency(), xrpAccount(), fhIGNORE_FREEZE, {}).xrp();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user