From 6d60f19d73b331abdcb2617914e6c031674b1b64 Mon Sep 17 00:00:00 2001 From: Miguel Portilla Date: Thu, 9 Jul 2015 13:24:29 -0400 Subject: [PATCH 1/2] Change NetOps processTransaction to use ref param --- src/ripple/app/misc/NetworkOPs.cpp | 5 ++--- src/ripple/app/misc/NetworkOPs.h | 2 +- src/ripple/app/tx/TransactionMaster.h | 2 +- src/ripple/app/tx/impl/TransactionMaster.cpp | 22 +++++++------------- src/ripple/rpc/impl/TransactionSign.cpp | 4 ++-- src/ripple/rpc/impl/TransactionSign.h | 2 +- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 95c71a244..0b3045271 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -238,7 +238,7 @@ public: void submitTransaction (Job&, STTx::pointer) override; void processTransaction ( - Transaction::pointer transaction, + Transaction::pointer& transaction, bool bAdmin, bool bLocal, FailHard failType) override; /** @@ -989,7 +989,7 @@ void NetworkOPsImp::submitTransaction (Job&, STTx::pointer iTrans) FailHard::no)); } -void NetworkOPsImp::processTransaction (Transaction::pointer transaction, +void NetworkOPsImp::processTransaction (Transaction::pointer& transaction, bool bAdmin, bool bLocal, FailHard failType) { auto ev = m_job_queue.getLoadEventAP (jtTXN_PROC, "ProcessTXN"); @@ -1168,7 +1168,6 @@ void NetworkOPsImp::apply (std::unique_lock& lock) // transaction should be held m_journal.debug << "Transaction should be held: " << e.result; e.transaction->setStatus (HELD); - getApp().getMasterTransaction().canonicalize (&e.transaction); m_ledgerMaster.addHeldTransaction (e.transaction); } } diff --git a/src/ripple/app/misc/NetworkOPs.h b/src/ripple/app/misc/NetworkOPs.h index 961f8319e..ef41fa549 100644 --- a/src/ripple/app/misc/NetworkOPs.h +++ b/src/ripple/app/misc/NetworkOPs.h @@ -168,7 +168,7 @@ public: * @param bLocal Client submission. * @param failType fail_hard setting from transaction submission. */ - virtual void processTransaction (Transaction::pointer transaction, + virtual void processTransaction (Transaction::pointer& transaction, bool bAdmin, bool bLocal, FailHard failType) = 0; virtual Transaction::pointer findTransactionByID (uint256 const& transactionID) = 0; virtual int findTransactionsByDestination (std::list&, diff --git a/src/ripple/app/tx/TransactionMaster.h b/src/ripple/app/tx/TransactionMaster.h index 140ff9a16..ee16b78e2 100644 --- a/src/ripple/app/tx/TransactionMaster.h +++ b/src/ripple/app/tx/TransactionMaster.h @@ -39,7 +39,7 @@ public: // return value: true = we had the transaction already bool inLedger (uint256 const& hash, std::uint32_t ledger); - bool canonicalize (Transaction::pointer* pTransaction); + void canonicalize (Transaction::pointer* pTransaction); void sweep (void); TaggedCache & getCache(); diff --git a/src/ripple/app/tx/impl/TransactionMaster.cpp b/src/ripple/app/tx/impl/TransactionMaster.cpp index 8e2723831..294b04c43 100644 --- a/src/ripple/app/tx/impl/TransactionMaster.cpp +++ b/src/ripple/app/tx/impl/TransactionMaster.cpp @@ -95,25 +95,17 @@ STTx::pointer TransactionMaster::fetch (std::shared_ptr const& item, return txn; } -bool TransactionMaster::canonicalize (Transaction::pointer* pTransaction) +void +TransactionMaster::canonicalize(Transaction::pointer* pTransaction) { - Transaction::pointer txn (*pTransaction); - - uint256 tid = txn->getID (); - - if (!tid) - return false; - - // VFALCO NOTE canonicalize can change the value of txn! - if (mCache.canonicalize (tid, txn)) + uint256 const tid = (*pTransaction)->getID(); + if (tid != zero) { + Transaction::pointer txn(*pTransaction); + // VFALCO NOTE canonicalize can change the value of txn! + mCache.canonicalize(tid, txn); *pTransaction = txn; - return true; } - - // VFALCO NOTE I am unsure if this is necessary but better safe than sorry. - *pTransaction = txn; - return false; } void TransactionMaster::sweep (void) diff --git a/src/ripple/rpc/impl/TransactionSign.cpp b/src/ripple/rpc/impl/TransactionSign.cpp index c0ab7d021..c36113d75 100644 --- a/src/ripple/rpc/impl/TransactionSign.cpp +++ b/src/ripple/rpc/impl/TransactionSign.cpp @@ -133,7 +133,7 @@ std::uint32_t TxnSignApiFacade::getSeq () const } void TxnSignApiFacade::processTransaction ( - Transaction::ref tpTrans, + Transaction::pointer& transaction, bool bAdmin, bool bLocal, NetworkOPs::FailHard failType) @@ -141,7 +141,7 @@ void TxnSignApiFacade::processTransaction ( if (!netOPs_) // Unit testing. return; - netOPs_->processTransaction (tpTrans, bAdmin, bLocal, failType); + netOPs_->processTransaction(transaction, bAdmin, bLocal, failType); } bool TxnSignApiFacade::findPathsForOneIssuer ( diff --git a/src/ripple/rpc/impl/TransactionSign.h b/src/ripple/rpc/impl/TransactionSign.h index 2da4d2e9e..3babc0ccf 100644 --- a/src/ripple/rpc/impl/TransactionSign.h +++ b/src/ripple/rpc/impl/TransactionSign.h @@ -75,7 +75,7 @@ public: STPath& fullLiquidityPath) const; void processTransaction ( - Transaction::ref tpTrans, + Transaction::pointer& transaction, bool bAdmin, bool bLocal, NetworkOPs::FailHard failType); From 3b751cc6e67b8d30f6c9cc71de754a3b6902c7d0 Mon Sep 17 00:00:00 2001 From: Mark Travis Date: Thu, 9 Jul 2015 22:57:16 +0000 Subject: [PATCH 2/2] Set version to 0.28.2-hf1 --- Builds/rpm/rippled.spec | 2 +- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Builds/rpm/rippled.spec b/Builds/rpm/rippled.spec index c81f9eda1..041d5bd22 100644 --- a/Builds/rpm/rippled.spec +++ b/Builds/rpm/rippled.spec @@ -1,5 +1,5 @@ Name: rippled -Version: 0.28.2 +Version: 0.28.2-hf1 Release: 1%{?dist} Summary: Ripple peer-to-peer network daemon diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index a9363bc61..934689873 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.28.2" + "0.28.2-hf1" // // Must follow the format described here: //