diff --git a/AccountState.h b/AccountState.h index 5faefbdd9d..ed77d2f4f8 100644 --- a/AccountState.h +++ b/AccountState.h @@ -29,8 +29,8 @@ public: uint64 getBalance() const { return mBalance; } uint32 getSeq() const { return mAccountSeq; } - bool credit(uint64 a) { mBalance+=a; } - bool charge(uint64 a) { assert(mBalance>=a); mBalance-=a; } + void credit(const uint64& a) { mBalance+=a; } + void charge(const uint64& a) { assert(mBalance>=a); mBalance-=a; } void incSeq() { mAccountSeq++; } void decSeq() { assert(mAccountSeq!=0); mAccountSeq--; } diff --git a/Ledger.cpp b/Ledger.cpp index 08cf0c5b43..93ab2749aa 100644 --- a/Ledger.cpp +++ b/Ledger.cpp @@ -36,8 +36,8 @@ Ledger::Ledger(const uint256 &parentHash, const uint256 &transHash, const uint25 } Ledger::Ledger(Ledger &prevLedger, uint64 ts) : mTimeStamp(ts), - mTransactionMap(new SHAMap()), mAccountStateMap(prevLedger.mAccountStateMap), - mClosed(false), mValidHash(false), mAccepted(false) + mClosed(false), mValidHash(false), mAccepted(false), + mTransactionMap(new SHAMap()), mAccountStateMap(prevLedger.mAccountStateMap) { mParentHash=prevLedger.getHash(); mLedgerSeq=prevLedger.mLedgerSeq+1; @@ -227,6 +227,7 @@ Ledger::TransResult Ledger::removeTransaction(Transaction::pointer trans) } updateAccountState(fromAccount); updateAccountState(toAccount); + return TR_SUCCESS; } catch (SHAMapException) { diff --git a/Ledger.h b/Ledger.h index d4c72b1ed0..e34916b312 100644 --- a/Ledger.h +++ b/Ledger.h @@ -69,7 +69,7 @@ public: void setClosed() { mClosed=true; } void setAccepted() { mAccepted=true; } bool isClosed() { return mClosed; } - bool isAccepted() { mAccepted=true; } + bool isAccepted() { return mAccepted; } // ledger signature operations void addRaw(Serializer &s); diff --git a/SHAMap.cpp b/SHAMap.cpp index 24943b8e82..cc59e9cf36 100644 --- a/SHAMap.cpp +++ b/SHAMap.cpp @@ -267,6 +267,7 @@ SHAMapItem::pointer SHAMap::lastBelow(SHAMapInnerNode::pointer node) return mLeaf->lastItem(); } } + return SHAMapItem::pointer(); } SHAMapItem::pointer SHAMap::peekNextItem(const uint256& id) @@ -478,6 +479,7 @@ bool SHAMap::fetchNode(const uint256& hash, std::vector& data) HashedObject::pointer obj(HashedObject::retrieve(hash)); if(!obj) return false; data=obj->getData(); + return true; } int SHAMap::flushDirty(int maxNodes, HashedObjectType t, uint32 seq) diff --git a/SHAMap.h b/SHAMap.h index 59b0fd20a8..54ad7ced28 100644 --- a/SHAMap.h +++ b/SHAMap.h @@ -126,7 +126,7 @@ private: protected: bool addUpdateItem(SHAMapItem::pointer); - bool delItem(const SHAMapItem::pointer i) { delItem(i->getTag()); } + bool delItem(const SHAMapItem::pointer i) { return delItem(i->getTag()); } bool delItem(const uint256& tag); public: diff --git a/ScopedLock.h b/ScopedLock.h index bcfc419c18..6778b7cf15 100644 --- a/ScopedLock.h +++ b/ScopedLock.h @@ -45,6 +45,7 @@ public: mValid=true; sl.mValid=false; } + return *this; } }; diff --git a/Serializer.cpp b/Serializer.cpp index 3561d840d5..79d25e1284 100644 --- a/Serializer.cpp +++ b/Serializer.cpp @@ -59,7 +59,9 @@ int Serializer::addRaw(const std::vector &vector) int Serializer::addRaw(const void *ptr, int len) { + int ret=mData.size(); mData.insert(mData.end(), (const char *) ptr, ((const char *)ptr)+len); + return ret; } bool Serializer::get16(uint16& o, int offset) const diff --git a/Wallet.cpp b/Wallet.cpp index d7b1577106..2273bb96ee 100644 --- a/Wallet.cpp +++ b/Wallet.cpp @@ -4,7 +4,7 @@ #include #include -LocalAccount::LocalAccount(bool) : mAmount(0), mSeqNum(0), mPublicKey(new CKey()) +LocalAccount::LocalAccount(bool) : mPublicKey(new CKey()), mAmount(0), mSeqNum(0) { mPrivateKey.MakeNewKey(); mPublicKey->SetPubKey(mPrivateKey.GetPubKey()); diff --git a/database/database.cpp b/database/database.cpp index 4a85ac0b56..52d7738200 100644 --- a/database/database.cpp +++ b/database/database.cpp @@ -1,6 +1,6 @@ #include "database.h" #include -#include +#include Database::Database(const char* host,const char* user,const char* pass) : mNumCol(0) @@ -82,7 +82,7 @@ bool Database::getColNumber(const char* colName,int* retIndex) { for(unsigned int n=0; n