Update the signature check flags if needed.

This commit is contained in:
JoelKatz
2013-05-15 15:55:35 -07:00
parent 586c6aee31
commit b00ac64941

View File

@@ -160,7 +160,6 @@ TER Transactor::checkSeq()
// check stuff before you bother to lock the ledger // check stuff before you bother to lock the ledger
TER Transactor::preCheck() TER Transactor::preCheck()
{ {
mTxnAccountID = mTxn.getSourceAccount().getAccountID(); mTxnAccountID = mTxn.getSourceAccount().getAccountID();
if (!mTxnAccountID) if (!mTxnAccountID)
{ {
@@ -177,11 +176,15 @@ TER Transactor::preCheck()
mSigningPubKey = RippleAddress::createAccountPublic(mTxn.getSigningPubKey()); mSigningPubKey = RippleAddress::createAccountPublic(mTxn.getSigningPubKey());
// Consistency: really signed. // Consistency: really signed.
if ( !isSetBit(mParams, tapNO_CHECK_SIGN) && !mTxn.checkSign(mSigningPubKey)) if (!mTxn.isKnownGood())
{ {
cLog(lsWARNING) << "applyTransaction: Invalid transaction: bad signature"; if (mTxn.isKnownBad() || (!isSetBit(mParams, tapNO_CHECK_SIGN) && !mTxn.checkSign(mSigningPubKey)))
{
return temINVALID; mTxn.setGood();
cLog(lsWARNING) << "applyTransaction: Invalid transaction: bad signature";
return temINVALID;
}
mTxn.isKnownGood();
} }
return tesSUCCESS; return tesSUCCESS;