mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Hanging locks.
This commit is contained in:
@@ -65,6 +65,10 @@ void SqliteDatabase::disconnect()
|
||||
// returns true if the query went ok
|
||||
bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok)
|
||||
{
|
||||
#ifdef DEBUG_HANGING_LOCKS
|
||||
assert(fail_ok || (mCurrentStmt == NULL));
|
||||
#endif
|
||||
|
||||
sqlite3_finalize(mCurrentStmt);
|
||||
|
||||
int rc = sqlite3_prepare_v2(mConnection, sql, -1, &mCurrentStmt, NULL);
|
||||
@@ -79,8 +83,8 @@ bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok)
|
||||
cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
endIterRows();
|
||||
return false;
|
||||
}
|
||||
rc = sqlite3_step(mCurrentStmt);
|
||||
if (rc == SQLITE_ROW)
|
||||
|
||||
@@ -84,6 +84,7 @@ bool ConnectionPool::savePeer(const std::string& strIp, int iPort, char code)
|
||||
// is lost.
|
||||
nothing();
|
||||
}
|
||||
db->endIterRows();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -146,6 +147,7 @@ bool ConnectionPool::peerAvailable(std::string& strIp, int& iPort)
|
||||
&& db->startIterRows())
|
||||
{
|
||||
strIpPort = db->getStrBinary("IpPort");
|
||||
db->endIterRows();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,6 +517,7 @@ bool ConnectionPool::peerScanSet(const std::string& strIp, int iPort)
|
||||
//cLog(lsINFO) << str(boost::format("Pool: Scan: schedule exists: %s %s (next %s, delay=%d)")
|
||||
// % mScanIp % mScanPort % tpNext % (tpNext-tpNow).total_seconds());
|
||||
}
|
||||
db->endIterRows();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -680,6 +683,7 @@ void ConnectionPool::scanRefresh()
|
||||
|
||||
db->getStr("IpPort", strIpPort);
|
||||
iInterval = db->getInt("ScanInterval");
|
||||
db->endIterRows();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1625,9 +1625,11 @@ void UniqueNodeList::nodeBootstrap()
|
||||
|
||||
if (db->executeSQL(str(boost::format("SELECT COUNT(*) AS Count FROM SeedDomains WHERE Source='%s' OR Source='%c';") % vsManual % vsValidator)) && db->startIterRows())
|
||||
iDomains = db->getInt("Count");
|
||||
db->endIterRows();
|
||||
|
||||
if (db->executeSQL(str(boost::format("SELECT COUNT(*) AS Count FROM SeedNodes WHERE Source='%s' OR Source='%c';") % vsManual % vsValidator)) && db->startIterRows())
|
||||
iNodes = db->getInt("Count");
|
||||
db->endIterRows();
|
||||
}
|
||||
|
||||
bool bLoaded = iDomains || iNodes;
|
||||
|
||||
Reference in New Issue
Block a user