Cmall cleanups and fixes.

This commit is contained in:
JoelKatz
2012-09-07 15:06:25 -07:00
parent 90fb093402
commit 390e628f10
8 changed files with 14 additions and 15 deletions

View File

@@ -104,8 +104,6 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)
sql.append(hash.GetHex());
sql.append("';");
std::string type;
uint32 index;
std::vector<unsigned char> data;
{
ScopedLock sl(theApp->getHashNodeDB()->getDBLock());
@@ -121,7 +119,7 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)
db->getStr("ObjType", type);
if (type.size() == 0) return HashedObject::pointer();
index = db->getBigInt("LedgerIndex");
uint32 index = db->getBigInt("LedgerIndex");
int size = db->getBinary("Object", NULL, 0);
data.resize(size);
@@ -131,7 +129,7 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)
assert(Serializer::getSHA512Half(data) == hash);
HashedObjectType htype = UNKNOWN;
switch(type[0])
switch (type[0])
{
case 'L': htype = LEDGER; break;
case 'T': htype = TRANSACTION; break;

View File

@@ -154,7 +154,7 @@ void Ledger::setAccepted(uint32 closeTime, int closeResolution, bool correctClos
void Ledger::setAccepted()
{ // used when we acquired the ledger
assert(mClosed && (mCloseResolution != 0) && (mCloseResolution != 0));
assert(mClosed && (mCloseTime != 0) && (mCloseResolution != 0));
mCloseTime -= mCloseTime % mCloseResolution;
updateHash();
mAccepted = true;

View File

@@ -209,12 +209,10 @@ bool LCTransaction::updatePosition(int percentTime, bool proposing)
}
LedgerConsensus::LedgerConsensus(const uint256& prevLCLHash, Ledger::ref previousLedger, uint32 closeTime)
: mState(lcsPRE_CLOSE), mCloseTime(closeTime), mPrevLedgerHash(prevLCLHash),
mPreviousLedger(previousLedger), mCurrentMSeconds(0), mClosePercent(0), mHaveCloseTimeConsensus(false)
: mState(lcsPRE_CLOSE), mCloseTime(closeTime), mPrevLedgerHash(prevLCLHash), mPreviousLedger(previousLedger),
mValSeed(theConfig.VALIDATION_SEED), mCurrentMSeconds(0), mClosePercent(0), mHaveCloseTimeConsensus(false),
mConsensusStartTime(boost::posix_time::microsec_clock::universal_time())
{
mValSeed = theConfig.VALIDATION_SEED;
mConsensusStartTime = boost::posix_time::microsec_clock::universal_time();
Log(lsDEBUG) << "Creating consensus object";
Log(lsTRACE) << "LCL:" << previousLedger->getHash() <<", ct=" << closeTime;
mPreviousProposers = theApp->getOPs().getPreviousProposers();

View File

@@ -9,12 +9,14 @@
#include <boost/thread/mutex.hpp>
#include <boost/asio.hpp>
#include "types.h"
class SNTPQuery
{
public:
bool mReceivedReply;
time_t mLocalTimeSent;
int mQueryNonce;
uint32 mQueryNonce;
SNTPQuery(time_t j = (time_t) -1) : mReceivedReply(false), mLocalTimeSent(j) { ; }
};

View File

@@ -582,7 +582,10 @@ public:
const uint160& getIssuerID() const { return mIssuerID; }
bool operator==(const STPathElement& t) const
{ return mType == t.mType && mAccountID == t.mAccountID && mCurrencyID == t.mCurrencyID && mIssuerID == mIssuerID; }
{
return mType == t.mType && mAccountID == t.mAccountID && mCurrencyID == t.mCurrencyID &&
mIssuerID == t.mIssuerID;
}
};
class STPath

View File

@@ -111,7 +111,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::sweep
if (mit->second->expired())
{
typename boost::unordered_map<key_type, weak_data_ptr>::iterator tmp = mit++;
mMap.erase(mit);
mMap.erase(mit++);
}
else
++mit;

View File

@@ -961,7 +961,6 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn,
{
Log(lsTRACE) << "applyTransaction>";
assert(mLedger);
mLedgerParentCloseTime = mLedger->getParentCloseTimeNC();
mNodes.init(txn.getTransactionID(), mLedger->getLedgerSeq());
#ifdef DEBUG

View File

@@ -295,7 +295,6 @@ private:
protected:
Ledger::pointer mLedger;
uint64 mLedgerParentCloseTime;
uint160 mTxnAccountID;
SLE::pointer mTxnAccount;