mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +00:00
Make specific generic uses of temINVALID.
This commit is contained in:
@@ -64,13 +64,17 @@ TER PaymentTransactor::doApply()
|
||||
|
||||
return temREDUNDANT;
|
||||
}
|
||||
else if (bMax
|
||||
&& ((saMaxAmount == saDstAmount && saMaxAmount.getCurrency() == saDstAmount.getCurrency())
|
||||
|| (saDstAmount.isNative() && saMaxAmount.isNative())))
|
||||
else if (bMax && saMaxAmount == saDstAmount && saMaxAmount.getCurrency() == saDstAmount.getCurrency())
|
||||
{
|
||||
cLog(lsINFO) << "Payment: Malformed transaction: bad SendMax.";
|
||||
cLog(lsINFO) << "Payment: Malformed transaction: Redundant SendMax.";
|
||||
|
||||
return temINVALID;
|
||||
return temREDUNDANT_SEND_MAX;
|
||||
}
|
||||
else if (bMax && (saDstAmount.isNative() && saMaxAmount.isNative()))
|
||||
{
|
||||
cLog(lsINFO) << "Payment: Malformed transaction: SendMax not allowed for XRP.";
|
||||
|
||||
return temBAD_SEND_MAX_XRP;
|
||||
}
|
||||
|
||||
SLE::pointer sleDst = mEngine->entryCache(ltACCOUNT_ROOT, Ledger::getAccountRootIndex(uDstAccountID));
|
||||
@@ -103,7 +107,7 @@ TER PaymentTransactor::doApply()
|
||||
{
|
||||
cLog(lsINFO) << "Payment: Malformed transaction: DestinationTag required.";
|
||||
|
||||
return temINVALID;
|
||||
return temDST_TAG_NEEDED;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -49,14 +49,18 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
|
||||
{ temBAD_PATH, "temBAD_PATH", "Malformed: Bad path." },
|
||||
{ temBAD_PATH_LOOP, "temBAD_PATH_LOOP", "Malformed: Loop in path." },
|
||||
{ temBAD_PUBLISH, "temBAD_PUBLISH", "Malformed: Bad publish." },
|
||||
{ temBAD_SIGNATURE, "temBAD_SIGNATURE", "Malformed: Bad signature." },
|
||||
{ temBAD_SRC_ACCOUNT, "temBAD_SRC_ACCOUNT", "Malformed: Bad source account." },
|
||||
{ temBAD_TRANSFER_RATE, "temBAD_TRANSFER_RATE", "Malformed: Transfer rate must be >= 1.0" },
|
||||
{ temBAD_SEQUENCE, "temBAD_SEQUENCE", "Malformed: Sequence is not in the past." },
|
||||
{ temBAD_SEND_MAX_XRP, "temBAD_SEND_MAX_XRP", "Malformed: Send max is not allowed for XRP." },
|
||||
{ temDST_IS_SRC, "temDST_IS_SRC", "Destination may not be source." },
|
||||
{ temDST_NEEDED, "temDST_NEEDED", "Destination not specified." },
|
||||
{ temDST_TAG_NEEDED, "temDST_TAG_NEEDED", "Destination tag required." },
|
||||
{ temINVALID, "temINVALID", "The transaction is ill-formed." },
|
||||
{ temINVALID_FLAG, "temINVALID_FLAG", "The transaction has an invalid flag." },
|
||||
{ temREDUNDANT, "temREDUNDANT", "Sends same currency to self." },
|
||||
{ temREDUNDANT_SEND_MAX, "temREDUNDANT_SEND_MAX", "Send max is redundant." },
|
||||
{ temRIPPLE_EMPTY, "temRIPPLE_EMPTY", "PathSet with no paths." },
|
||||
{ temUNCERTAIN, "temUNCERTAIN", "In process of determining result. Never returned." },
|
||||
{ temUNKNOWN, "temUNKNOWN", "The transactions requires logic not implemented yet." },
|
||||
|
||||
@@ -36,6 +36,9 @@ enum TER // aka TransactionEngineResult
|
||||
temBAD_PATH_LOOP,
|
||||
temBAD_PUBLISH,
|
||||
temBAD_TRANSFER_RATE,
|
||||
temBAD_SEND_MAX_XRP,
|
||||
temBAD_SIGNATURE,
|
||||
temBAD_SRC_ACCOUNT,
|
||||
temBAD_SEQUENCE,
|
||||
temDST_IS_SRC,
|
||||
temDST_NEEDED,
|
||||
@@ -43,6 +46,7 @@ enum TER // aka TransactionEngineResult
|
||||
temINVALID,
|
||||
temINVALID_FLAG,
|
||||
temREDUNDANT,
|
||||
temREDUNDANT_SEND_MAX,
|
||||
temRIPPLE_EMPTY,
|
||||
temUNCERTAIN, // An intermediate result used internally, should never be returned.
|
||||
temUNKNOWN,
|
||||
|
||||
@@ -157,7 +157,7 @@ TER Transactor::preCheck()
|
||||
{
|
||||
cLog(lsWARNING) << "applyTransaction: bad source id";
|
||||
|
||||
return temINVALID;
|
||||
return temBAD_SRC_ACCOUNT;
|
||||
}
|
||||
|
||||
// Extract signing key
|
||||
|
||||
Reference in New Issue
Block a user