Trivial cleanups.

This commit is contained in:
JoelKatz
2013-02-09 16:17:12 -08:00
parent 4ef325e8a9
commit 4abdb34c20
14 changed files with 21 additions and 20 deletions

View File

@@ -184,7 +184,7 @@ public:
bool haveConsensus(bool forReal); bool haveConsensus(bool forReal);
bool peerPosition(const LedgerProposal::pointer&); bool peerPosition(LedgerProposal::ref);
bool peerHasSet(Peer::ref peer, const uint256& set, ripple::TxSetStatus status); bool peerHasSet(Peer::ref peer, const uint256& set, ripple::TxSetStatus status);

View File

@@ -893,7 +893,7 @@ void LedgerEntrySet::ownerCountAdjust(const uint160& uOwnerID, int iAmount, SLE:
sleRoot->setFieldU32(sfOwnerCount, uOwnerCount+iAmount); 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. bool bOwnerNode = sleOffer->isFieldPresent(sfOwnerNode); // Detect legacy dirs.
uint64 uOwnerNode = sleOffer->getFieldU64(sfOwnerNode); uint64 uOwnerNode = sleOffer->getFieldU64(sfOwnerNode);

View File

@@ -108,7 +108,7 @@ public:
// Offer functions. // Offer functions.
TER offerDelete(const uint256& uOfferIndex); 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. // Balance functions.
uint32 rippleTransferRate(const uint160& uIssuerID); uint32 rippleTransferRate(const uint160& uIssuerID);

View File

@@ -17,7 +17,7 @@ uint32 LedgerMaster::getCurrentLedgerIndex()
return mCurrentLedger->getLedgerSeq(); return mCurrentLedger->getLedgerSeq();
} }
void LedgerMaster::addHeldTransaction(const Transaction::pointer& transaction) void LedgerMaster::addHeldTransaction(Transaction::ref transaction)
{ // returns true if transaction was added { // returns true if transaction was added
boost::recursive_mutex::scoped_lock ml(mLock); boost::recursive_mutex::scoped_lock ml(mLock);
mHeldTransactions.push_back(transaction->getSTransaction()); mHeldTransactions.push_back(transaction->getSTransaction());

View File

@@ -48,8 +48,8 @@ protected:
bool mPubThread; // Publish thread is running bool mPubThread; // Publish thread is running
void applyFutureTransactions(uint32 ledgerIndex); void applyFutureTransactions(uint32 ledgerIndex);
bool isValidTransaction(const Transaction::pointer& trans); bool isValidTransaction(Transaction::ref trans);
bool isTransactionOnFutureList(const Transaction::pointer& trans); bool isTransactionOnFutureList(Transaction::ref trans);
bool acquireMissingLedger(Ledger::ref from, const uint256& ledgerHash, uint32 ledgerSeq); bool acquireMissingLedger(Ledger::ref from, const uint256& ledgerHash, uint32 ledgerSeq);
void asyncAccept(Ledger::pointer); void asyncAccept(Ledger::pointer);
@@ -122,7 +122,7 @@ public:
mCompleteLedgers.setRange(minV, maxV); mCompleteLedgers.setRange(minV, maxV);
} }
void addHeldTransaction(const Transaction::pointer& trans); void addHeldTransaction(Transaction::ref trans);
void fixMismatch(Ledger::ref ledger); void fixMismatch(Ledger::ref ledger);
bool haveLedgerRange(uint32 from, uint32 to); bool haveLedgerRange(uint32 from, uint32 to);

View File

@@ -32,6 +32,7 @@ public:
static const uint32 seqLeave = 0xffffffff; // leaving the consensus process static const uint32 seqLeave = 0xffffffff; // leaving the consensus process
typedef boost::shared_ptr<LedgerProposal> pointer; typedef boost::shared_ptr<LedgerProposal> pointer;
typedef const pointer& ref;
// proposal from peer // proposal from peer
LedgerProposal(const uint256& prevLgr, uint32 proposeSeq, const uint256& propose, LedgerProposal(const uint256& prevLgr, uint32 proposeSeq, const uint256& propose,

View File

@@ -178,7 +178,7 @@ void NetworkOPs::submitTransaction(Job&, SerializedTransaction::pointer iTrans,
// Sterilize transaction through serialization. // Sterilize transaction through serialization.
// This is fully synchronous and deprecated // 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; Serializer s;
tpTrans->getSTransaction()->add(s); tpTrans->getSTransaction()->add(s);
@@ -1100,7 +1100,7 @@ std::vector<RippleAddress>
return accounts; return accounts;
} }
bool NetworkOPs::recvValidation(const SerializedValidation::pointer& val) bool NetworkOPs::recvValidation(SerializedValidation::ref val)
{ {
cLog(lsDEBUG) << "recvValidation " << val->getLedgerHash(); cLog(lsDEBUG) << "recvValidation " << val->getLedgerHash();
return theApp->getValidations().addValidation(val); return theApp->getValidations().addValidation(val);
@@ -1491,7 +1491,7 @@ uint32 NetworkOPs::acceptLedger()
return mLedgerMaster->getCurrentLedger()->getLedgerSeq(); 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<LedgerProposal::pointer>& props = mStoredProposals[peerPublic.getNodeID()]; std::list<LedgerProposal::pointer>& props = mStoredProposals[peerPublic.getNodeID()];
if (props.size() >= (unsigned)(mLastCloseProposers + 10)) if (props.size() >= (unsigned)(mLastCloseProposers + 10))

View File

@@ -164,7 +164,7 @@ public:
// //
typedef boost::function<void (Transaction::pointer, TER)> stCallback; // must complete immediately typedef boost::function<void (Transaction::pointer, TER)> stCallback; // must complete immediately
void submitTransaction(Job&, SerializedTransaction::pointer, stCallback callback = stCallback()); 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(); void runTransactionQueue();
Transaction::pointer processTransaction(Transaction::pointer, stCallback); Transaction::pointer processTransaction(Transaction::pointer, stCallback);
@@ -224,7 +224,7 @@ public:
RippleAddress nodePublic, uint256 checkLedger, bool sigGood); RippleAddress nodePublic, uint256 checkLedger, bool sigGood);
SMAddNode gotTXData(const boost::shared_ptr<Peer>& peer, const uint256& hash, SMAddNode gotTXData(const boost::shared_ptr<Peer>& peer, const uint256& hash,
const std::list<SHAMapNode>& nodeIDs, const std::list< std::vector<unsigned char> >& nodeData); const std::list<SHAMapNode>& nodeIDs, const std::list< std::vector<unsigned char> >& nodeData);
bool recvValidation(const SerializedValidation::pointer& val); bool recvValidation(SerializedValidation::ref val);
void takePosition(int seq, SHAMap::ref position); void takePosition(int seq, SHAMap::ref position);
SHAMap::pointer getTXMap(const uint256& hash); SHAMap::pointer getTXMap(const uint256& hash);
bool hasTXSet(const boost::shared_ptr<Peer>& peer, const uint256& set, ripple::TxSetStatus status); bool hasTXSet(const boost::shared_ptr<Peer>& peer, const uint256& set, ripple::TxSetStatus status);
@@ -255,7 +255,7 @@ public:
uint32 acceptLedger(); uint32 acceptLedger();
boost::unordered_map<uint160, boost::unordered_map<uint160,
std::list<LedgerProposal::pointer> >& peekStoredProposals() { return mStoredProposals; } std::list<LedgerProposal::pointer> >& peekStoredProposals() { return mStoredProposals; }
void storeProposal(const LedgerProposal::pointer& proposal, const RippleAddress& peerPublic); void storeProposal(LedgerProposal::ref proposal, const RippleAddress& peerPublic);
uint256 getConsensusLCL(); uint256 getConsensusLCL();
bool addWantedHash(const uint256& h); bool addWantedHash(const uint256& h);

View File

@@ -19,7 +19,7 @@ TER OfferCreateTransactor::takeOffers(
bool bPassive, bool bPassive,
const uint256& uBookBase, const uint256& uBookBase,
const uint160& uTakerAccountID, const uint160& uTakerAccountID,
const SLE::pointer& sleTakerAccount, SLE::ref sleTakerAccount,
const STAmount& saTakerPays, const STAmount& saTakerPays,
const STAmount& saTakerGets, const STAmount& saTakerGets,
STAmount& saTakerPaid, STAmount& saTakerPaid,

View File

@@ -9,7 +9,7 @@ class OfferCreateTransactor : public Transactor
bool bPassive, bool bPassive,
const uint256& uBookBase, const uint256& uBookBase,
const uint160& uTakerAccountID, const uint160& uTakerAccountID,
const SLE::pointer& sleTakerAccount, SLE::ref sleTakerAccount,
const STAmount& saTakerPays, const STAmount& saTakerPays,
const STAmount& saTakerGets, const STAmount& saTakerGets,
STAmount& saTakerPaid, STAmount& saTakerPaid,

View File

@@ -26,7 +26,7 @@ void TransactionEngine::txnWrite()
typedef std::map<uint256, LedgerEntrySetEntry>::value_type u256_LES_pair; typedef std::map<uint256, LedgerEntrySetEntry>::value_type u256_LES_pair;
BOOST_FOREACH(u256_LES_pair& it, mNodes) BOOST_FOREACH(u256_LES_pair& it, mNodes)
{ {
const SLE::pointer& sleEntry = it.second.mEntry; SLE::ref sleEntry = it.second.mEntry;
switch (it.second.mAction) switch (it.second.mAction)
{ {

View File

@@ -48,7 +48,7 @@ private:
bool bPassive, bool bPassive,
const uint256& uBookBase, const uint256& uBookBase,
const uint160& uTakerAccountID, const uint160& uTakerAccountID,
const SLE::pointer& sleTakerAccount, SLE::ref sleTakerAccount,
const STAmount& saTakerPays, const STAmount& saTakerPays,
const STAmount& saTakerGets, const STAmount& saTakerGets,
STAmount& saTakerPaid, STAmount& saTakerPaid,

View File

@@ -34,7 +34,7 @@ VSpointer ValidationCollection::findSet(const uint256& ledgerHash)
return mValidations.fetch(ledgerHash); return mValidations.fetch(ledgerHash);
} }
bool ValidationCollection::addValidation(const SerializedValidation::pointer& val) bool ValidationCollection::addValidation(SerializedValidation::ref val)
{ {
RippleAddress signer = val->getSignerPublic(); RippleAddress signer = val->getSignerPublic();
bool isCurrent = false; bool isCurrent = false;
@@ -316,7 +316,7 @@ void ValidationCollection::doWrite()
Serializer s(1024); Serializer s(1024);
db->executeSQL("BEGIN TRANSACTION;"); db->executeSQL("BEGIN TRANSACTION;");
BOOST_FOREACH(const SerializedValidation::pointer& it, vector) BOOST_FOREACH(SerializedValidation::ref it, vector)
{ {
s.erase(); s.erase();
it->add(s); it->add(s);

View File

@@ -35,7 +35,7 @@ protected:
public: public:
ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false) { ; } ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false) { ; }
bool addValidation(const SerializedValidation::pointer&); bool addValidation(SerializedValidation::ref);
ValidationSet getValidations(const uint256& ledger); ValidationSet getValidations(const uint256& ledger);
void getValidationCount(const uint256& ledger, bool currentOnly, int& trusted, int& untrusted); void getValidationCount(const uint256& ledger, bool currentOnly, int& trusted, int& untrusted);
void getValidationTypes(const uint256& ledger, int& full, int& partial); void getValidationTypes(const uint256& ledger, int& full, int& partial);