Improve pseudo-transaction handling (RIPD-1454, RIPD-1455):

Adds additional checks to prevent relaying and retrying pseudo-transactions.
This commit is contained in:
Brad Chase
2017-04-11 17:05:10 -04:00
committed by Nik Bougalis
parent 8002a13dd2
commit f2787dc35c
9 changed files with 210 additions and 53 deletions

View File

@@ -77,10 +77,10 @@ invoke_preclaim(PreclaimContext const& ctx)
// list one, preflight will have already a flagged a failure.
auto const id = ctx.tx.getAccountID(sfAccount);
auto const baseFee = T::calculateBaseFee(ctx);
TER result;
if (id != zero)
{
result = T::checkSeq(ctx);
TER result = T::checkSeq(ctx);
if (result != tesSUCCESS)
return { result, baseFee };
@@ -95,17 +95,9 @@ invoke_preclaim(PreclaimContext const& ctx)
if (result != tesSUCCESS)
return { result, baseFee };
result = T::preclaim(ctx);
if (result != tesSUCCESS)
return{ result, baseFee };
}
else
{
result = tesSUCCESS;
}
return { tesSUCCESS, baseFee };
return{ T::preclaim(ctx), baseFee };
}
static