From 5a38a713824d7fdf19fe1cb0735a42701b66d210 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 30 Dec 2011 18:48:29 -0800 Subject: [PATCH] Missing startIterRows. --- HashedObject.cpp | 4 ++-- Ledger.cpp | 2 +- PubKeyCache.cpp | 4 ++-- Transaction.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/HashedObject.cpp b/HashedObject.cpp index c620d7eadc..f530e2950b 100644 --- a/HashedObject.cpp +++ b/HashedObject.cpp @@ -89,8 +89,8 @@ HashedObject::pointer HashedObject::retrieve(const uint256& hash) ScopedLock sl(theApp->getHashNodeDB()->getDBLock()); Database* db=theApp->getHashNodeDB()->getDB(); - if(!db->executeSQL(sql.c_str())) return HashedObject::pointer(); - if(!db->getNextRow()) return HashedObject::pointer(); + if(!db->executeSQL(sql.c_str()) || !db->startIterRows() || !db->getNextRow()) + return HashedObject::pointer(); std::string type; db->getStr("ObjType", type); diff --git a/Ledger.cpp b/Ledger.cpp index 9572eec9fc..94133fa8bb 100644 --- a/Ledger.cpp +++ b/Ledger.cpp @@ -343,7 +343,7 @@ Ledger::pointer Ledger::getSQL(const std::string& sql) { ScopedLock sl(theApp->getLedgerDB()->getDBLock()); Database *db=theApp->getLedgerDB()->getDB(); - if(!db->executeSQL(sql.c_str()) || !db->getNextRow()) + if(!db->executeSQL(sql.c_str()) || !db->startIterRows() || !db->getNextRow()) return Ledger::pointer(); db->getStr("LedgerHash", hash); diff --git a/PubKeyCache.cpp b/PubKeyCache.cpp index 61ec3ce2fa..686eb97a9c 100644 --- a/PubKeyCache.cpp +++ b/PubKeyCache.cpp @@ -23,8 +23,8 @@ CKey::pointer PubKeyCache::locate(const uint160& id) { // is it in the database ScopedLock sl(theApp->getTxnDB()->getDBLock()); Database* db=theApp->getTxnDB()->getDB(); - if(!db->executeSQL(sql.c_str())) return CKey::pointer(); - if(!db->getNextRow()) return CKey::pointer(); + if(!db->executeSQL(sql.c_str()) || !db->startIterRows() || !db->getNextRow()) + return CKey::pointer(); pkSize=db->getBinary("PubKey", &(data.front()), data.size()); db->endIterRows(); } diff --git a/Transaction.cpp b/Transaction.cpp index f66b9f1b98..b603cacfe3 100644 --- a/Transaction.cpp +++ b/Transaction.cpp @@ -175,8 +175,8 @@ Transaction::pointer Transaction::transactionFromSQL(const std::string& sql) ScopedLock sl(theApp->getTxnDB()->getDBLock()); Database* db=theApp->getTxnDB()->getDB(); - if(!db->executeSQL(sql.c_str())) return Transaction::pointer(); - if(!db->getNextRow()) return Transaction::pointer(); + if(!db->executeSQL(sql.c_str()) || !db->startIterRows() || !db->getNextRow()) + return Transaction::pointer(); db->getStr("TransID", transID); db->getStr("FromID", fromID);