diff --git a/src/cpp/ripple/LedgerConsensus.h b/src/cpp/ripple/LedgerConsensus.h index 15890b089..1e6ef4794 100644 --- a/src/cpp/ripple/LedgerConsensus.h +++ b/src/cpp/ripple/LedgerConsensus.h @@ -184,7 +184,7 @@ public: bool haveConsensus(bool forReal); - bool peerPosition(const LedgerProposal::pointer&); + bool peerPosition(LedgerProposal::ref); bool peerHasSet(Peer::ref peer, const uint256& set, ripple::TxSetStatus status); diff --git a/src/cpp/ripple/LedgerEntrySet.cpp b/src/cpp/ripple/LedgerEntrySet.cpp index d23e0dc43..15461e52e 100644 --- a/src/cpp/ripple/LedgerEntrySet.cpp +++ b/src/cpp/ripple/LedgerEntrySet.cpp @@ -893,7 +893,7 @@ void LedgerEntrySet::ownerCountAdjust(const uint160& uOwnerID, int iAmount, SLE: sleRoot->setFieldU32(sfOwnerCount, uOwnerCount+iAmount); } -TER LedgerEntrySet::offerDelete(const SLE::pointer& sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID) +TER LedgerEntrySet::offerDelete(SLE::ref sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID) { bool bOwnerNode = sleOffer->isFieldPresent(sfOwnerNode); // Detect legacy dirs. uint64 uOwnerNode = sleOffer->getFieldU64(sfOwnerNode); diff --git a/src/cpp/ripple/LedgerEntrySet.h b/src/cpp/ripple/LedgerEntrySet.h index 197a55208..682277592 100644 --- a/src/cpp/ripple/LedgerEntrySet.h +++ b/src/cpp/ripple/LedgerEntrySet.h @@ -108,7 +108,7 @@ public: // Offer functions. TER offerDelete(const uint256& uOfferIndex); - TER offerDelete(const SLE::pointer& sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID); + TER offerDelete(SLE::ref sleOffer, const uint256& uOfferIndex, const uint160& uOwnerID); // Balance functions. uint32 rippleTransferRate(const uint160& uIssuerID); diff --git a/src/cpp/ripple/LedgerMaster.cpp b/src/cpp/ripple/LedgerMaster.cpp index 3d2969141..cefaea2f3 100644 --- a/src/cpp/ripple/LedgerMaster.cpp +++ b/src/cpp/ripple/LedgerMaster.cpp @@ -17,7 +17,7 @@ uint32 LedgerMaster::getCurrentLedgerIndex() return mCurrentLedger->getLedgerSeq(); } -void LedgerMaster::addHeldTransaction(const Transaction::pointer& transaction) +void LedgerMaster::addHeldTransaction(Transaction::ref transaction) { // returns true if transaction was added boost::recursive_mutex::scoped_lock ml(mLock); mHeldTransactions.push_back(transaction->getSTransaction()); diff --git a/src/cpp/ripple/LedgerMaster.h b/src/cpp/ripple/LedgerMaster.h index e3cb37d98..91fa0e035 100644 --- a/src/cpp/ripple/LedgerMaster.h +++ b/src/cpp/ripple/LedgerMaster.h @@ -48,8 +48,8 @@ protected: bool mPubThread; // Publish thread is running void applyFutureTransactions(uint32 ledgerIndex); - bool isValidTransaction(const Transaction::pointer& trans); - bool isTransactionOnFutureList(const Transaction::pointer& trans); + bool isValidTransaction(Transaction::ref trans); + bool isTransactionOnFutureList(Transaction::ref trans); bool acquireMissingLedger(Ledger::ref from, const uint256& ledgerHash, uint32 ledgerSeq); void asyncAccept(Ledger::pointer); @@ -122,7 +122,7 @@ public: mCompleteLedgers.setRange(minV, maxV); } - void addHeldTransaction(const Transaction::pointer& trans); + void addHeldTransaction(Transaction::ref trans); void fixMismatch(Ledger::ref ledger); bool haveLedgerRange(uint32 from, uint32 to); diff --git a/src/cpp/ripple/LedgerProposal.h b/src/cpp/ripple/LedgerProposal.h index b5176c7c9..c4a42f9e3 100644 --- a/src/cpp/ripple/LedgerProposal.h +++ b/src/cpp/ripple/LedgerProposal.h @@ -32,6 +32,7 @@ public: static const uint32 seqLeave = 0xffffffff; // leaving the consensus process typedef boost::shared_ptr pointer; + typedef const pointer& ref; // proposal from peer LedgerProposal(const uint256& prevLgr, uint32 proposeSeq, const uint256& propose, diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 7982c7cfc..bdceb63c4 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -178,7 +178,7 @@ void NetworkOPs::submitTransaction(Job&, SerializedTransaction::pointer iTrans, // Sterilize transaction through serialization. // This is fully synchronous and deprecated -Transaction::pointer NetworkOPs::submitTransactionSync(const Transaction::pointer& tpTrans, bool bSubmit) +Transaction::pointer NetworkOPs::submitTransactionSync(Transaction::ref tpTrans, bool bSubmit) { Serializer s; tpTrans->getSTransaction()->add(s); @@ -1100,7 +1100,7 @@ std::vector return accounts; } -bool NetworkOPs::recvValidation(const SerializedValidation::pointer& val) +bool NetworkOPs::recvValidation(SerializedValidation::ref val) { cLog(lsDEBUG) << "recvValidation " << val->getLedgerHash(); return theApp->getValidations().addValidation(val); @@ -1491,7 +1491,7 @@ uint32 NetworkOPs::acceptLedger() return mLedgerMaster->getCurrentLedger()->getLedgerSeq(); } -void NetworkOPs::storeProposal(const LedgerProposal::pointer& proposal, const RippleAddress& peerPublic) +void NetworkOPs::storeProposal(LedgerProposal::ref proposal, const RippleAddress& peerPublic) { std::list& props = mStoredProposals[peerPublic.getNodeID()]; if (props.size() >= (unsigned)(mLastCloseProposers + 10)) diff --git a/src/cpp/ripple/NetworkOPs.h b/src/cpp/ripple/NetworkOPs.h index 9ce5709f4..918ea4ccf 100644 --- a/src/cpp/ripple/NetworkOPs.h +++ b/src/cpp/ripple/NetworkOPs.h @@ -164,7 +164,7 @@ public: // typedef boost::function stCallback; // must complete immediately void submitTransaction(Job&, SerializedTransaction::pointer, stCallback callback = stCallback()); - Transaction::pointer submitTransactionSync(const Transaction::pointer& tpTrans, bool bSubmit=true); + Transaction::pointer submitTransactionSync(Transaction::ref tpTrans, bool bSubmit=true); void runTransactionQueue(); Transaction::pointer processTransaction(Transaction::pointer, stCallback); @@ -224,7 +224,7 @@ public: RippleAddress nodePublic, uint256 checkLedger, bool sigGood); SMAddNode gotTXData(const boost::shared_ptr& peer, const uint256& hash, const std::list& nodeIDs, const std::list< std::vector >& nodeData); - bool recvValidation(const SerializedValidation::pointer& val); + bool recvValidation(SerializedValidation::ref val); void takePosition(int seq, SHAMap::ref position); SHAMap::pointer getTXMap(const uint256& hash); bool hasTXSet(const boost::shared_ptr& peer, const uint256& set, ripple::TxSetStatus status); @@ -255,7 +255,7 @@ public: uint32 acceptLedger(); boost::unordered_map >& peekStoredProposals() { return mStoredProposals; } - void storeProposal(const LedgerProposal::pointer& proposal, const RippleAddress& peerPublic); + void storeProposal(LedgerProposal::ref proposal, const RippleAddress& peerPublic); uint256 getConsensusLCL(); bool addWantedHash(const uint256& h); diff --git a/src/cpp/ripple/OfferCreateTransactor.cpp b/src/cpp/ripple/OfferCreateTransactor.cpp index bbe3522ec..648872575 100644 --- a/src/cpp/ripple/OfferCreateTransactor.cpp +++ b/src/cpp/ripple/OfferCreateTransactor.cpp @@ -19,7 +19,7 @@ TER OfferCreateTransactor::takeOffers( bool bPassive, const uint256& uBookBase, const uint160& uTakerAccountID, - const SLE::pointer& sleTakerAccount, + SLE::ref sleTakerAccount, const STAmount& saTakerPays, const STAmount& saTakerGets, STAmount& saTakerPaid, diff --git a/src/cpp/ripple/OfferCreateTransactor.h b/src/cpp/ripple/OfferCreateTransactor.h index dbe57f89d..ad1671735 100644 --- a/src/cpp/ripple/OfferCreateTransactor.h +++ b/src/cpp/ripple/OfferCreateTransactor.h @@ -9,7 +9,7 @@ class OfferCreateTransactor : public Transactor bool bPassive, const uint256& uBookBase, const uint160& uTakerAccountID, - const SLE::pointer& sleTakerAccount, + SLE::ref sleTakerAccount, const STAmount& saTakerPays, const STAmount& saTakerGets, STAmount& saTakerPaid, diff --git a/src/cpp/ripple/TransactionEngine.cpp b/src/cpp/ripple/TransactionEngine.cpp index 4a31227cc..ec26231f0 100644 --- a/src/cpp/ripple/TransactionEngine.cpp +++ b/src/cpp/ripple/TransactionEngine.cpp @@ -26,7 +26,7 @@ void TransactionEngine::txnWrite() typedef std::map::value_type u256_LES_pair; BOOST_FOREACH(u256_LES_pair& it, mNodes) { - const SLE::pointer& sleEntry = it.second.mEntry; + SLE::ref sleEntry = it.second.mEntry; switch (it.second.mAction) { diff --git a/src/cpp/ripple/TransactionEngine.h b/src/cpp/ripple/TransactionEngine.h index ab80191c8..4f421602d 100644 --- a/src/cpp/ripple/TransactionEngine.h +++ b/src/cpp/ripple/TransactionEngine.h @@ -48,7 +48,7 @@ private: bool bPassive, const uint256& uBookBase, const uint160& uTakerAccountID, - const SLE::pointer& sleTakerAccount, + SLE::ref sleTakerAccount, const STAmount& saTakerPays, const STAmount& saTakerGets, STAmount& saTakerPaid, diff --git a/src/cpp/ripple/ValidationCollection.cpp b/src/cpp/ripple/ValidationCollection.cpp index 84dbc8f14..0d503748c 100644 --- a/src/cpp/ripple/ValidationCollection.cpp +++ b/src/cpp/ripple/ValidationCollection.cpp @@ -34,7 +34,7 @@ VSpointer ValidationCollection::findSet(const uint256& ledgerHash) return mValidations.fetch(ledgerHash); } -bool ValidationCollection::addValidation(const SerializedValidation::pointer& val) +bool ValidationCollection::addValidation(SerializedValidation::ref val) { RippleAddress signer = val->getSignerPublic(); bool isCurrent = false; @@ -316,7 +316,7 @@ void ValidationCollection::doWrite() Serializer s(1024); db->executeSQL("BEGIN TRANSACTION;"); - BOOST_FOREACH(const SerializedValidation::pointer& it, vector) + BOOST_FOREACH(SerializedValidation::ref it, vector) { s.erase(); it->add(s); diff --git a/src/cpp/ripple/ValidationCollection.h b/src/cpp/ripple/ValidationCollection.h index 7bba8bad4..86398bdb4 100644 --- a/src/cpp/ripple/ValidationCollection.h +++ b/src/cpp/ripple/ValidationCollection.h @@ -35,7 +35,7 @@ protected: public: ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false) { ; } - bool addValidation(const SerializedValidation::pointer&); + bool addValidation(SerializedValidation::ref); ValidationSet getValidations(const uint256& ledger); void getValidationCount(const uint256& ledger, bool currentOnly, int& trusted, int& untrusted); void getValidationTypes(const uint256& ledger, int& full, int& partial);