From 341d198ffebd051e1ef41cea7835d93e9f9d59fe Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 11 Feb 2013 16:48:52 -0800 Subject: [PATCH] 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. --- src/cpp/ripple/Transactor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpp/ripple/Transactor.cpp b/src/cpp/ripple/Transactor.cpp index b9ace30fd3..f3bd4e1a4d 100644 --- a/src/cpp/ripple/Transactor.cpp +++ b/src/cpp/ripple/Transactor.cpp @@ -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();