From 39606523f70616fb172ed10f1f544fe4f9e683a9 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Mon, 30 Apr 2012 13:24:16 -0700 Subject: [PATCH] Refresh scaning after scoring. --- src/UniqueNodeList.cpp | 7 +++++-- src/Wallet.cpp | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/UniqueNodeList.cpp b/src/UniqueNodeList.cpp index afa17c2fa9..a6e1a22742 100644 --- a/src/UniqueNodeList.cpp +++ b/src/UniqueNodeList.cpp @@ -449,6 +449,9 @@ void UniqueNodeList::scoreTimerHandler(const boost::system::error_code& err) // Score again if needed. scoreNext(false); + + // Scan may be dirty due to new ips. + theApp->getConnectionPool().scanRefresh(); } } @@ -923,14 +926,14 @@ void UniqueNodeList::fetchNext() if (!bFull) { // Determine next scan. - std::string strDomain; + std::string strDomain; boost::posix_time::ptime tpNext; boost::posix_time::ptime tpNow; ScopedLock sl(theApp->getWalletDB()->getDBLock()); Database *db=theApp->getWalletDB()->getDB(); - if (db->executeSQL("SELECT Domain,Next FROM SeedDomains ORDER BY Next LIMIT 1;") + if (db->executeSQL("SELECT Domain,Next FROM SeedDomains INDEXED BY SeedDomainNext ORDER BY Next LIMIT 1;") && db->startIterRows()) { int iNext = db->getInt("Next"); diff --git a/src/Wallet.cpp b/src/Wallet.cpp index 5ed60a168b..426e84700f 100644 --- a/src/Wallet.cpp +++ b/src/Wallet.cpp @@ -371,7 +371,6 @@ bool Wallet::nodeIdentityLoad() ScopedLock sl(theApp->getWalletDB()->getDBLock()); bool bSuccess = false; - if(db->executeSQL("SELECT * FROM NodeIdentity;") && db->startIterRows()) { std::string strPublicKey, strPrivateKey;