mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 17:35:51 +00:00
Fix SQL for tracking Misc information.
This commit is contained in:
@@ -65,8 +65,11 @@ const char *WalletDBInit[] = {
|
||||
);",
|
||||
|
||||
// Miscellaneous persistent information
|
||||
// Integer: 1 : Used to simplify SQL.
|
||||
// ScoreUpdated: when scores was last updated.
|
||||
// FetchUpdated: when last fetch succeeded.
|
||||
"CREATE TABLE Misc ( \
|
||||
Magic INTEGER UNIQUE NOT NULL, \
|
||||
ScoreUpdated DATETIME, \
|
||||
FetchUpdated DATETIME \
|
||||
);",
|
||||
|
||||
@@ -56,7 +56,7 @@ bool UniqueNodeList::miscLoad()
|
||||
ScopedLock sl(theApp->getWalletDB()->getDBLock());
|
||||
Database *db=theApp->getWalletDB()->getDB();
|
||||
|
||||
if (!db->executeSQL("SELECT * FROM Misc;")) return false;
|
||||
if (!db->executeSQL("SELECT * FROM Misc WHERE Magic=1;")) return false;
|
||||
|
||||
bool bAvail = !!db->startIterRows();
|
||||
|
||||
@@ -73,7 +73,7 @@ bool UniqueNodeList::miscSave()
|
||||
Database* db=theApp->getWalletDB()->getDB();
|
||||
ScopedLock sl(theApp->getWalletDB()->getDBLock());
|
||||
|
||||
db->executeSQL(str(boost::format("REPLACE INTO Misc (FetchUpdated,ScoreUpdated) VALUES (%d,%d);")
|
||||
db->executeSQL(str(boost::format("REPLACE INTO Misc (Magic,FetchUpdated,ScoreUpdated) VALUES (1,%d,%d);")
|
||||
% iToSeconds(mtpFetchUpdated)
|
||||
% iToSeconds(mtpScoreUpdated)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user