From 82dbf5794b51ba4a56f76495a487bcb30da0f055 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 19 Jun 2013 10:52:21 -0700 Subject: [PATCH] Fix bug in regular key set transactions. --- src/cpp/ripple/RegularKeySetTransactor.cpp | 3 ++- src/cpp/ripple/Transactor.cpp | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpp/ripple/RegularKeySetTransactor.cpp b/src/cpp/ripple/RegularKeySetTransactor.cpp index 13dbcf4b41..0c89cad5f0 100644 --- a/src/cpp/ripple/RegularKeySetTransactor.cpp +++ b/src/cpp/ripple/RegularKeySetTransactor.cpp @@ -9,7 +9,8 @@ SETUP_LOG (RegularKeySetTransactor) uint64 RegularKeySetTransactor::calculateBaseFee () { - if ( ! (mTxnAccount->getFlags () & lsfPasswordSpent) + if ( mTxnAccount + && (! (mTxnAccount->getFlags () & lsfPasswordSpent)) && (mSigningPubKey.getAccountID () == mTxnAccountID)) { // flag is armed and they signed with the right account diff --git a/src/cpp/ripple/Transactor.cpp b/src/cpp/ripple/Transactor.cpp index 9d0b41795f..95cfd5746f 100644 --- a/src/cpp/ripple/Transactor.cpp +++ b/src/cpp/ripple/Transactor.cpp @@ -209,11 +209,10 @@ TER Transactor::apply () if (terResult != tesSUCCESS) return (terResult); - calculateFee (); - boost::recursive_mutex::scoped_lock sl (mEngine->getLedger ()->mLock); mTxnAccount = mEngine->entryCache (ltACCOUNT_ROOT, Ledger::getAccountRootIndex (mTxnAccountID)); + calculateFee (); // Find source account // If are only forwarding, due to resource limitations, we might verifying only some transactions, this would be probabilistic.