StringFunctions::Convert(idparts[2],index);\r
\r
// wait for all data to be received from connection\r
StringFunctions::Convert(idparts[2],index);\r
\r
// wait for all data to be received from connection\r
\r
// get count of identities added in last 24 hours\r
st=m_db->Prepare("SELECT COUNT(*) FROM tblIdentity WHERE DateAdded>=?;");\r
\r
// get count of identities added in last 24 hours\r
st=m_db->Prepare("SELECT COUNT(*) FROM tblIdentity WHERE DateAdded>=?;");\r
{\r
// find the identity name and public key of the identity publishing the trust list\r
std::string publisherid="";\r
{\r
// find the identity name and public key of the identity publishing the trust list\r
std::string publisherid="";\r
// drop all existing peer trust from this identity - we will rebuild it when we go through each trust in the xml file\r
st=m_db->Prepare("DELETE FROM tblPeerTrust WHERE IdentityID=?;");\r
st.Bind(0,identityid);\r
// drop all existing peer trust from this identity - we will rebuild it when we go through each trust in the xml file\r
st=m_db->Prepare("DELETE FROM tblPeerTrust WHERE IdentityID=?;");\r
st.Bind(0,identityid);\r
\r
// select identities we want to query (we've seen them today and they are publishing trust list) - sort by their trust level (descending) with secondary sort on how long ago we saw them (ascending)\r
sql="SELECT IdentityID FROM tblIdentity ";\r
\r
// select identities we want to query (we've seen them today and they are publishing trust list) - sort by their trust level (descending) with secondary sort on how long ago we saw them (ascending)\r
sql="SELECT IdentityID FROM tblIdentity ";\r
- sql+="WHERE Name IS NOT NULL AND Name <> '' AND PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+Poco::DateTimeFormatter::format(date,"%Y-%m-%d")+"' AND PublishTrustList='true' AND LocalTrustListTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalTrustListTrust') AND ( PeerTrustListTrust IS NULL OR PeerTrustListTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerTrustListTrust') )";\r
+ sql+="WHERE Name IS NOT NULL AND Name <> '' AND PublicKey IS NOT NULL AND PublicKey <> '' AND LastSeen>='"+Poco::DateTimeFormatter::format(date,"%Y-%m-%d")+"' AND PublishTrustList='true' AND LocalTrustListTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalTrustListTrust') AND ( PeerTrustListTrust IS NULL OR PeerTrustListTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerTrustListTrust') ) AND tblIdentity.FailureCount<=(SELECT OptionValue FROM tblOption WHERE Option='MaxFailureCount')";\r
sql+="ORDER BY LocalTrustListTrust DESC, LastSeen;";\r
\r
SQLite3DB::Statement st=m_db->Prepare(sql);\r
sql+="ORDER BY LocalTrustListTrust DESC, LastSeen;";\r
\r
SQLite3DB::Statement st=m_db->Prepare(sql);\r