diff --git a/src/HashedObject.cpp b/src/HashedObject.cpp index 52fe5899c..5cc6ef09f 100644 --- a/src/HashedObject.cpp +++ b/src/HashedObject.cpp @@ -64,7 +64,7 @@ bool HashedObject::store(HashedObjectType type, uint32 index, const std::vector< ScopedLock sl(theApp->getHashNodeDB()->getDBLock()); Database* db=theApp->getHashNodeDB()->getDB(); - return db->executeSQL(sql.c_str()); + return db->executeSQL(sql); } bool HashedObject::store() const @@ -91,7 +91,7 @@ HashedObject::pointer HashedObject::retrieve(const uint256& hash) ScopedLock sl(theApp->getHashNodeDB()->getDBLock()); Database* db=theApp->getHashNodeDB()->getDB(); - if(!db->executeSQL(sql.c_str()) || !db->startIterRows()) + if(!db->executeSQL(sql) || !db->startIterRows()) return HashedObject::pointer(); std::string type; diff --git a/src/Ledger.cpp b/src/Ledger.cpp index c3f1c58ad..68cf4c799 100644 --- a/src/Ledger.cpp +++ b/src/Ledger.cpp @@ -224,7 +224,7 @@ bool Ledger::unitTest() uint256 Ledger::getHash() { if(!mValidHash) updateHash(); - return(mHash); + return(mHash); } void Ledger::saveAcceptedLedger(Ledger::pointer ledger) @@ -247,7 +247,7 @@ void Ledger::saveAcceptedLedger(Ledger::pointer ledger) sql.append("');"); ScopedLock sl(theApp->getLedgerDB()->getDBLock()); - theApp->getLedgerDB()->getDB()->executeSQL(sql.c_str()); + theApp->getLedgerDB()->getDB()->executeSQL(sql); // write out dirty nodes while(ledger->mTransactionMap->flushDirty(64, TRANSACTION_NODE, ledger->mLedgerSeq)) diff --git a/src/LedgerAcquire.h b/src/LedgerAcquire.h index 239c0c468..939d8fda2 100644 --- a/src/LedgerAcquire.h +++ b/src/LedgerAcquire.h @@ -35,13 +35,13 @@ protected: public: LedgerAcquire(const uint256& hash); - const uint256& getHash() const { return mHash; } - bool isComplete() const { return mComplete; } - bool isFailed() const { return mFailed; } - bool isBase() const { return mHaveBase; } - bool isAcctStComplete() const { return mHaveState; } - bool isTransComplete() const { return mHaveTransactions; } - Ledger::pointer getLedger() { return mLedger; } + const uint256& getHash() const { return mHash; } + bool isComplete() const { return mComplete; } + bool isFailed() const { return mFailed; } + bool isBase() const { return mHaveBase; } + bool isAcctStComplete() const { return mHaveState; } + bool isTransComplete() const { return mHaveTransactions; } + Ledger::pointer getLedger() { return mLedger; } void addOnComplete(boost::function); @@ -60,7 +60,7 @@ protected: public: LedgerAcquireMaster() { ; } - + LedgerAcquire::pointer findCreate(const uint256& hash); LedgerAcquire::pointer find(const uint256& hash); bool hasLedger(const uint256& ledgerHash); @@ -69,3 +69,4 @@ public: }; #endif +// vim:ts=4 diff --git a/src/LedgerFormats.h b/src/LedgerFormats.h index ba2a379d5..86ef7205c 100644 --- a/src/LedgerFormats.h +++ b/src/LedgerFormats.h @@ -21,3 +21,4 @@ struct LedgerEntryFormat extern LedgerEntryFormat LedgerFormats[]; extern LedgerEntryFormat* getLgrFormat(LedgerEntryType t); #endif +// vim:ts=4 diff --git a/src/LedgerHistory.cpp b/src/LedgerHistory.cpp index 918bcb206..5d393fc1e 100644 --- a/src/LedgerHistory.cpp +++ b/src/LedgerHistory.cpp @@ -77,10 +77,11 @@ Ledger::pointer LedgerHistory::canonicalizeLedger(Ledger::pointer ledger, bool s if(ret) return ret; return ledger; } - + // save input ledger in map if not in map, otherwise return corresponding map ledger boost::recursive_mutex::scoped_lock sl(mLedgersByHash.peekMutex()); mLedgersByHash.canonicalize(h, ledger); if(ledger->isAccepted()) mLedgersByIndex[ledger->getLedgerSeq()]=ledger; return ledger; } +// vim:ts=4 diff --git a/src/LedgerHistory.h b/src/LedgerHistory.h index 9073adf26..e593c739b 100644 --- a/src/LedgerHistory.h +++ b/src/LedgerHistory.h @@ -11,7 +11,7 @@ class LedgerHistory public: LedgerHistory(); - + void addLedger(Ledger::pointer ledger); void addAcceptedLedger(Ledger::pointer ledger); diff --git a/src/LedgerIndex.cpp b/src/LedgerIndex.cpp index b5fbdfb22..9bd356531 100644 --- a/src/LedgerIndex.cpp +++ b/src/LedgerIndex.cpp @@ -14,3 +14,4 @@ uint256 Ledger::getRippleIndex(const uint160& accountID, const uint160& extendTo memcpy(base.begin() + (160/8), (accountID^currency).begin(), (256/8)-(160/8)); return base; } +// vim:ts=4 diff --git a/src/LedgerMaster.h b/src/LedgerMaster.h index 8caa1012e..53d7eba42 100644 --- a/src/LedgerMaster.h +++ b/src/LedgerMaster.h @@ -67,3 +67,4 @@ public: }; #endif +// vim:ts=4 diff --git a/src/LedgerNode.cpp b/src/LedgerNode.cpp index 8fd1d2d5a..77d4ed43a 100644 --- a/src/LedgerNode.cpp +++ b/src/LedgerNode.cpp @@ -109,3 +109,4 @@ SerializedLedgerEntry::pointer Ledger::getNickname(LedgerStateParms& parms, cons return SerializedLedgerEntry::pointer(); } } +// vim:ts=4 diff --git a/src/PubKeyCache.cpp b/src/PubKeyCache.cpp index 540237449..7705e2fe8 100644 --- a/src/PubKeyCache.cpp +++ b/src/PubKeyCache.cpp @@ -23,7 +23,7 @@ CKey::pointer PubKeyCache::locate(const NewcoinAddress& id) { // is it in the database ScopedLock sl(theApp->getTxnDB()->getDBLock()); Database* db=theApp->getTxnDB()->getDB(); - if(!db->executeSQL(sql.c_str()) || !db->startIterRows()) + if(!db->executeSQL(sql) || !db->startIterRows()) return CKey::pointer(); pkSize=db->getBinary("PubKey", &(data.front()), data.size()); db->endIterRows(); @@ -63,7 +63,7 @@ CKey::pointer PubKeyCache::store(const NewcoinAddress& id, CKey::pointer key) sql.append(");"); ScopedLock dbl(theApp->getTxnDB()->getDBLock()); - theApp->getTxnDB()->getDB()->executeSQL(sql.c_str(), true); + theApp->getTxnDB()->getDB()->executeSQL(sql, true); return key; } diff --git a/src/SHAMap.cpp b/src/SHAMap.cpp index 0738b16bb..b7f94cfa9 100644 --- a/src/SHAMap.cpp +++ b/src/SHAMap.cpp @@ -342,7 +342,7 @@ SHAMapItem::pointer SHAMap::peekItem(const uint256& id) bool SHAMap::hasItem(const uint256& id) { // does the tree have an item with this ID - boost::recursive_mutex::scoped_lock sl(mLock); + boost::recursive_mutex::scoped_lock sl(mLock); SHAMapTreeNode::pointer leaf=walkTo(id, false); if(!leaf) return false; SHAMapItem::pointer item=leaf->peekItem(); @@ -472,7 +472,7 @@ bool SHAMap::addGiveItem(SHAMapItem::pointer item, bool isTransaction) node->makeInner(); int b1, b2; - + while( (b1=node->selectBranch(tag)) == (b2=node->selectBranch(otherItem->getTag())) ) { // we need a new inner node, since both go on same branch at this level #ifdef ST_DEBUG @@ -675,4 +675,4 @@ bool SHAMap::TestSHAMap() return false; return true; } - +// vim:ts=4 diff --git a/src/SHAMap.h b/src/SHAMap.h index fb1eb79ad..edbbbe4f7 100644 --- a/src/SHAMap.h +++ b/src/SHAMap.h @@ -251,7 +251,7 @@ protected: bool walkBranch(SHAMapTreeNode::pointer node, SHAMapItem::pointer otherMapItem, bool isFirstMap, SHAMapDiff& differences, int& maxCount); - + public: // build new map @@ -327,3 +327,4 @@ public: }; #endif +// vim:ts=4 diff --git a/src/SHAMapNodes.cpp b/src/SHAMapNodes.cpp index d968b82ba..ff894c148 100644 --- a/src/SHAMapNodes.cpp +++ b/src/SHAMapNodes.cpp @@ -368,3 +368,4 @@ const uint256& SHAMapTreeNode::getChildHash(int m) const assert((m >= 0) && (m < 16) && (mType == tnINNER)); return mHashes[m]; } +// vim:ts=4 diff --git a/src/Transaction.cpp b/src/Transaction.cpp index 6d0f7c4fb..d9789acd3 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -228,7 +228,7 @@ bool Transaction::save() const ScopedLock sl(theApp->getTxnDB()->getDBLock()); Database* db = theApp->getTxnDB()->getDB(); - return db->executeSQL(sql.c_str()); + return db->executeSQL(sql); } Transaction::pointer Transaction::transactionFromSQL(const std::string& sql) @@ -339,7 +339,7 @@ static bool isHex(char j) if ((j >= 'a') && (j <= 'f')) return true; return false; } - + bool Transaction::isHexTxID(const std::string& txid) { if (txid.size() != 64) return false; diff --git a/src/ValidationCollection.cpp b/src/ValidationCollection.cpp index 22e87c500..26dcc13de 100644 --- a/src/ValidationCollection.cpp +++ b/src/ValidationCollection.cpp @@ -39,7 +39,7 @@ void ValidationCollection::addToDB(newcoin::Validation& valid,int weCare) db->escape(hanko.begin(),hanko.GetSerializeSize(),hankoStr); db->escape(sig.begin(),sig.GetSerializeSize(),sigStr); string sql=strprintf("INSERT INTO Validations (LedgerIndex,Hash,Hanko,SeqNum,Sig,WeCare) values (%d,%s,%s,%d,%s,%d)",valid.ledgerindex(),hashStr.c_str(),hankoStr.c_str(),valid.seqnum(),sigStr.c_str(),weCare); - db->executeSQL(sql.c_str()); + db->executeSQL(sql); } diff --git a/src/Wallet.cpp b/src/Wallet.cpp index 8a19099e8..dcc0fe9cb 100644 --- a/src/Wallet.cpp +++ b/src/Wallet.cpp @@ -190,7 +190,7 @@ LocalAccountFamily::pointer LocalAccountFamily::readFamily(const NewcoinAddress& ScopedLock sl(theApp->getWalletDB()->getDBLock()); Database *db=theApp->getWalletDB()->getDB(); - if(!db->executeSQL(sql.c_str()) || !db->startIterRows()) + if(!db->executeSQL(sql) || !db->startIterRows()) return LocalAccountFamily::pointer(); db->getStr("Comment", comment); @@ -223,7 +223,7 @@ void LocalAccountFamily::write(bool is_new) sql.append(");"); ScopedLock sl(theApp->getWalletDB()->getDBLock()); - theApp->getWalletDB()->getDB()->executeSQL(sql.c_str()); + theApp->getWalletDB()->getDB()->executeSQL(sql); } std::string LocalAccountFamily::getSQLFields() @@ -446,7 +446,7 @@ void Wallet::load() ScopedLock sl(theApp->getWalletDB()->getDBLock()); Database *db=theApp->getWalletDB()->getDB(); - if(!db->executeSQL(sql.c_str())) + if(!db->executeSQL(sql)) { #ifdef DEBUG std::cerr << "Unable to load wallet" << std::endl;