Clean up. No more 'tep'.

This commit is contained in:
JoelKatz
2013-01-21 12:26:42 -08:00
parent 16d8ec5ec9
commit a6793b3d3b
2 changed files with 8 additions and 8 deletions

View File

@@ -112,9 +112,11 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
cLog(lsINFO) << "applyTransaction: terResult=" << strToken << " : " << terResult << " : " << strHuman; cLog(lsINFO) << "applyTransaction: terResult=" << strToken << " : " << terResult << " : " << strHuman;
if (isTecClaim(terResult) && !isSetBit(params, tapRETRY)) if (isTesSuccess(terResult))
didApply = true;
else if (isTecClaim(terResult) && !isSetBit(params, tapRETRY))
{ // only claim the transaction fee { // only claim the transaction fee
cLog(lsINFO) << "Reprocessing to only claim fee"; cLog(lsDEBUG) << "Reprocessing to only claim fee";
mNodes.clear(); mNodes.clear();
SLE::pointer txnAcct = entryCache(ltACCOUNT_ROOT, Ledger::getAccountRootIndex(txn.getSourceAccount())); SLE::pointer txnAcct = entryCache(ltACCOUNT_ROOT, Ledger::getAccountRootIndex(txn.getSourceAccount()));
@@ -151,14 +153,12 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
} }
} }
} }
else if ((terResult == tesSUCCESS) || (isTesSuccess(terResult) && !isSetBit(params, tapRETRY)))
didApply = true;
else else
cLog(lsINFO) << "Not applying transaction"; cLog(lsDEBUG) << "Not applying transaction";
if (didApply) if (didApply)
{ {
// Transaction succeeded fully or (retries are not allowed and the transaction succeeded partially). // Transaction succeeded fully or (retries are not allowed and the transaction could claim a fee)
Serializer m; Serializer m;
mNodes.calcRawMeta(m, terResult, mTxnSeq++); mNodes.calcRawMeta(m, terResult, mTxnSeq++);
@@ -177,8 +177,8 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa
if (!mLedger->addTransaction(txID, s, m)) if (!mLedger->addTransaction(txID, s, m))
assert(false); assert(false);
STAmount saPaid = txn.getTransactionFee();
// Charge whatever fee they specified. // Charge whatever fee they specified.
STAmount saPaid = txn.getTransactionFee();
mLedger->destroyCoins(saPaid.getNValue()); mLedger->destroyCoins(saPaid.getNValue());
} }
} }

View File

@@ -134,7 +134,7 @@ enum TER // aka TransactionEngineResult
#define isTemMalformed(x) ((x) >= temMALFORMED && (x) < tefFAILURE) #define isTemMalformed(x) ((x) >= temMALFORMED && (x) < tefFAILURE)
#define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY) #define isTefFailure(x) ((x) >= tefFAILURE && (x) < terRETRY)
#define isTerRetry(x) ((x) >= terRETRY && (x) < tesSUCCESS) #define isTerRetry(x) ((x) >= terRETRY && (x) < tesSUCCESS)
#define isTesSuccess(x) ((x) >= tesSUCCESS) #define isTesSuccess(x) ((x) == tesSUCCESS)
#define isTecClaim(x) ((x) >= tecCLAIM) #define isTecClaim(x) ((x) >= tecCLAIM)
bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman); bool transResultInfo(TER terCode, std::string& strToken, std::string& strHuman);