Clean up LedgerEntrySet and TransactionEngine:

* Reduce public interfaces
* Remove wrapper functions
* Remove freeze timed cutover code
* Return results directly instead of via ref parameters
This commit is contained in:
Nik Bougalis
2015-03-28 19:41:03 -07:00
committed by Tom Ritchford
parent 5ce3ed3555
commit 67c666b033
25 changed files with 173 additions and 288 deletions

View File

@@ -1852,27 +1852,26 @@ int applyTransaction (TransactionEngine& engine
try
{
bool didApply;
TER result = engine.applyTransaction (*txn, parms, didApply);
auto result = engine.applyTransaction (*txn, parms);
if (didApply)
if (result.second)
{
WriteLog (lsDEBUG, LedgerConsensus)
<< "Transaction success: " << transHuman (result);
<< "Transaction applied: " << transHuman (result.first);
return LedgerConsensusImp::resultSuccess;
}
if (isTefFailure (result) || isTemMalformed (result) ||
isTelLocal (result))
if (isTefFailure (result.first) || isTemMalformed (result.first) ||
isTelLocal (result.first))
{
// failure
WriteLog (lsDEBUG, LedgerConsensus)
<< "Transaction failure: " << transHuman (result);
<< "Transaction failure: " << transHuman (result.first);
return LedgerConsensusImp::resultFail;
}
WriteLog (lsDEBUG, LedgerConsensus)
<< "Transaction retry: " << transHuman (result);
<< "Transaction retry: " << transHuman (result.first);
return LedgerConsensusImp::resultRetry;
}
catch (...)