Merge tepPARTIAL into tecCLAIMED.

This commit is contained in:
Arthur Britto
2013-01-03 13:04:07 -08:00
parent 01764aa090
commit 75d935e0df
7 changed files with 15 additions and 33 deletions

View File

@@ -2567,8 +2567,7 @@ cLog(lsDEBUG) << boost::str(boost::format("rippleCalc: Summary: %d rate: %s qual
{
// Have sent maximum allowed. Partial payment not allowed.
terResult = tepPATH_PARTIAL;
lesActive = lesBase; // Revert to just fees charged.
terResult = tecPATH_PARTIAL;
}
else
{
@@ -2581,14 +2580,13 @@ cLog(lsDEBUG) << boost::str(boost::format("rippleCalc: Summary: %d rate: %s qual
else if (!bPartialPayment)
{
// Partial payment not allowed.
terResult = tepPATH_PARTIAL;
lesActive = lesBase; // Revert to just fees charged.
terResult = tecPATH_PARTIAL;
}
// Partial payment ok.
else if (!saDstAmountAct)
{
// No payment at all.
terResult = tecPATH_DRY; // Revert to just fees charged is built into tec.
terResult = tecPATH_DRY;
}
else
{

View File

@@ -116,10 +116,6 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
{
didApply = true;
}
else if (isTepPartial(terResult) && !isSetBit(params, tapRETRY))
{
didApply = true;
}
else if (isTecClaim(terResult) && !isSetBit(params, tapRETRY))
{ // only claim the transaction fee
cLog(lsINFO) << "Reprocessing to only claim fee";

View File

@@ -17,6 +17,8 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
{ tecNO_LINE_INSUF_RESERVE, "tecNO_LINE_INSUF_RESERVE", "No such line. Too little reserve to create it." },
{ tecNO_LINE_REDUNDANT, "tecNO_LINE_REDUNDANT", "Can't set non-existant line to default." },
{ tecPATH_DRY, "tecPATH_DRY", "Path could not send partial amount." },
{ tecPATH_PARTIAL, "tecPATH_PARTIAL", "Path could not send full amount." },
{ tecUNFUNDED, "tecUNFUNDED", "Source account had insufficient balance for transaction." },
{ tefFAILURE, "tefFAILURE", "Failed to apply." },
@@ -58,9 +60,6 @@ bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman)
{ temUNCERTAIN, "temUNCERTAIN", "In process of determining result. Never returned." },
{ temUNKNOWN, "temUNKNOWN", "The transactions requires logic not implemented yet." },
{ tepPARTIAL, "tepPARTIAL", "Partial success." },
{ tepPATH_PARTIAL, "tepPATH_PARTIAL", "Path could not send full amount." },
{ terRETRY, "terRETRY", "Retry transaction." },
{ terFUNDS_SPENT, "terFUNDS_SPENT", "Can't set password, password set funds already spent." },
{ terINSUF_FEE_B, "terINSUF_FEE_B", "Account balance can't pay fee." },

View File

@@ -92,20 +92,9 @@ enum TER // aka TransactionEngineResult
// - Forwarded
tesSUCCESS = 0,
// 100 .. 119 P Partial success (SR) (ripple transaction with no good paths, pay to non-existent account)
// 100 .. 129 C Claim fee only (ripple transaction with no good paths, pay to non-existent account, no path)
// Causes:
// - Success, but does not achieve optimal result.
// Implications:
// - Applied
// - Forwarded
// Only allowed as a return code of appliedTransaction when !tapRetry. Otherwise, treated as terRETRY.
//
// DO NOT CHANGE THESE NUMBERS: They appear in ledger meta data.
tepPARTIAL = 100,
tepPATH_PARTIAL = 101,
// 120 .. C Claim fee only (CO) (no path)
// Causes:
// - Invalid transaction or no effect, but claim fee to use the sequence number.
// Implications:
// - Applied
@@ -113,7 +102,8 @@ enum TER // aka TransactionEngineResult
// Only allowed as a return code of appliedTransaction when !tapRetry. Otherwise, treated as terRETRY.
//
// DO NOT CHANGE THESE NUMBERS: They appear in ledger meta data.
tecCLAIM = 120,
tecCLAIM = 100,
tecPATH_PARTIAL = 101,
tecDIR_FULL = 121,
tecINSUF_RESERVE_LINE = 122,
tecINSUF_RESERVE_OFFER = 123,
@@ -130,7 +120,6 @@ enum TER // aka TransactionEngineResult
#define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY)
#define isTerRetry(x) ((x) >= terRETRY && (x) < tesSUCCESS)
#define isTepSuccess(x) ((x) >= tesSUCCESS)
#define isTepPartial(x) ((x) >= tepPATH_PARTIAL && (x) < tecCLAIM)
#define isTecClaim(x) ((x) >= tecCLAIM)
bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman);