Must check sequence before checking fee and signature. Otherwise lots of bad things happen:

1) We needlessly check signatures on applied.
2) We return the wrong error code if a transaction that was already applied has an insufficient fee.
This commit is contained in:
JoelKatz
2013-02-11 16:48:52 -08:00
parent b512ed3df2
commit 341d198ffe

View File

@@ -206,15 +206,15 @@ TER Transactor::apply()
mHasAuthKey = mTxnAccount->isFieldPresent(sfRegularKey);
}
terResult = checkSeq();
if (terResult != tesSUCCESS) return(terResult);
terResult = payFee();
if (terResult != tesSUCCESS) return(terResult);
terResult = checkSig();
if (terResult != tesSUCCESS) return(terResult);
terResult = checkSeq();
if (terResult != tesSUCCESS) return(terResult);
mEngine->entryModify(mTxnAccount);
return doApply();