mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-19 18:15:50 +00:00
change check from xrp to native + error handle
This commit is contained in:
@@ -229,7 +229,7 @@ PayChanCreate::preflight(PreflightContext const& ctx)
|
||||
return ret;
|
||||
|
||||
STAmount const amount {ctx.tx[sfAmount]};
|
||||
if (!isXRP(amount))
|
||||
if (!amount.native())
|
||||
{
|
||||
if (!ctx.rules.enabled(featurePaychanAndEscrowForTokens))
|
||||
return temDISABLED;
|
||||
@@ -280,11 +280,11 @@ PayChanCreate::preclaim(PreclaimContext const& ctx)
|
||||
auto const dst = ctx.tx[sfDestination];
|
||||
|
||||
// Check reserve and funds availability
|
||||
if (isXRP(amount) && balance < reserve + amount)
|
||||
if (amount.native() && balance < reserve + amount)
|
||||
{
|
||||
return tecUNFUNDED;
|
||||
}
|
||||
else if (!isXRP(amount)) {
|
||||
else if (!amount.native()) {
|
||||
if (!ctx.view.rules().enabled(featurePaychanAndEscrowForTokens))
|
||||
return temDISABLED;
|
||||
|
||||
@@ -403,7 +403,7 @@ PayChanCreate::doApply()
|
||||
}
|
||||
|
||||
// Deduct owner's balance, increment owner count
|
||||
if (isXRP(amount))
|
||||
if (amount.native())
|
||||
(*sle)[sfBalance] = (*sle)[sfBalance] - amount;
|
||||
else
|
||||
{
|
||||
@@ -414,7 +414,7 @@ PayChanCreate::doApply()
|
||||
ctx_.view().peek(keylet::line(account, amount.getIssuer(), amount.getCurrency()));
|
||||
|
||||
if (!sleLine)
|
||||
return tecUNFUNDED_PAYMENT;
|
||||
return tecNO_LINE;
|
||||
|
||||
TER result =
|
||||
trustAdjustLockedBalance(
|
||||
|
||||
Reference in New Issue
Block a user