fix disalllow XRP bug

This commit is contained in:
dangell7
2023-01-19 12:54:14 -05:00
parent 4e9d1fd575
commit b99e445c56
2 changed files with 3 additions and 5 deletions

View File

@@ -297,7 +297,7 @@ EscrowCreate::doApply()
// Obeying the lsfDissalowXRP flag was a bug. Piggyback on
// featureDepositAuth to remove the bug.
if (!ctx_.view().rules().enabled(featureDepositAuth) &&
((*sled)[sfFlags] & lsfDisallowXRP))
isXRP(amount) && ((*sled)[sfFlags] & lsfDisallowXRP))
return tecNO_TARGET;
}

View File

@@ -340,7 +340,7 @@ PayChanCreate::preclaim(PreclaimContext const& ctx)
// Obeying the lsfDisallowXRP flag was a bug. Piggyback on
// featureDepositAuth to remove the bug.
if (!ctx.view.rules().enabled(featureDepositAuth) &&
((*sled)[sfFlags] & lsfDisallowXRP))
isXRP(amount) && ((*sled)[sfFlags] & lsfDisallowXRP))
return tecNO_TARGET;
}
@@ -741,9 +741,7 @@ PayChanClaim::doApply()
// Obeying the lsfDisallowXRP flag was a bug. Piggyback on
// featureDepositAuth to remove the bug.
bool const depositAuth{ctx_.view().rules().enabled(featureDepositAuth)};
if (!depositAuth &&
// RH TODO: does this condition need to be changed for IOU paychans?
(txAccount == src && (sled->getFlags() & lsfDisallowXRP)))
if (!depositAuth && chanBalance.native() && (txAccount == src && (sled->getFlags() & lsfDisallowXRP)))
return tecNO_TARGET;
// Check whether the destination account requires deposit authorization.