Change how fail_hard transactions are handled.

FIXES: #2847

* Transactions that are submitted with the fail_hard flag
  and that result in any TER code besides tesSUCCESS shall
  be neither queued nor held.

[FOLD] Keep tec results out of the open ledger when fail_hard:

* Improve TransactionStatus const correctness, and remove redundant
  `local` check
* Check open ledger tx count in fail_hard tests
* Fix some wrapping
* Remove duplicate test
This commit is contained in:
Devon White
2019-11-15 13:34:02 -05:00
committed by CJ Cobb
parent 7d867b806d
commit cd9732b47a
7 changed files with 120 additions and 24 deletions

View File

@@ -670,7 +670,15 @@ Transactor::operator()()
if (ctx_.size() > oversizeMetaDataCap)
result = tecOVERSIZE;
if ((result == tecOVERSIZE) || (result == tecKILLED) ||
if (isTecClaim(result) && (view().flags() & tapFAIL_HARD))
{
// If the tapFAIL_HARD flag is set, a tec result
// must not do anything
ctx_.discard();
applied = false;
}
else if ((result == tecOVERSIZE) || (result == tecKILLED) ||
(isTecClaimHardFail (result, view().flags())))
{
JLOG(j_.trace()) << "reapplying because of " << transToken(result);