- // select all local ids that aren't single use and that aren't currently inserting a puzzle\r
- SQLite3DB::Recordset rs=m_db->Query("SELECT LocalIdentityID FROM tblLocalIdentity WHERE SingleUse='false' AND InsertingPuzzle='false' AND PrivateKey IS NOT NULL AND PrivateKey <> '' ORDER BY LastInsertedPuzzle;");\r
+ // select all local ids that aren't single use and that aren't currently inserting a puzzle and are publishing a trust list\r
+ SQLite3DB::Recordset rs=m_db->Query("SELECT LocalIdentityID FROM tblLocalIdentity WHERE PublishTrustList='true' AND SingleUse='false' AND InsertingPuzzle='false' AND PrivateKey IS NOT NULL AND PrivateKey <> '' ORDER BY LastInsertedPuzzle;");\r
\r
while(!rs.AtEnd())\r
{\r
\r
while(!rs.AtEnd())\r
{\r
+ std::string localidentityidstr;\r
DateTime now;\r
now.SetToGMTime();\r
\r
DateTime now;\r
now.SetToGMTime();\r
\r
+ if(rs.GetField(0))\r
+ {\r
+ localidentityidstr=rs.GetField(0);\r
+ }\r
+\r
// if this identity has any non-solved puzzles for today, we don't need to insert a new puzzle\r
// if this identity has any non-solved puzzles for today, we don't need to insert a new puzzle\r
- SQLite3DB::Recordset rs2=m_db->Query("SELECT UUID FROM tblIntroductionPuzzleInserts WHERE Day='"+now.Format("%Y-%m-%d")+"' AND FoundSolution='false';");\r
+ SQLite3DB::Recordset rs2=m_db->Query("SELECT UUID FROM tblIntroductionPuzzleInserts WHERE Day='"+now.Format("%Y-%m-%d")+"' AND FoundSolution='false' AND LocalIdentityID="+localidentityidstr+";");\r
\r
// identity doesn't have any non-solved puzzles for today - start a new insert\r
if(rs2.Empty()==true)\r
\r
// identity doesn't have any non-solved puzzles for today - start a new insert\r
if(rs2.Empty()==true)\r
@@ -195,7+201,9 @@ void IntroductionPuzzleInserter::StartInsert(const long localidentityid)