Make UNL bootstrapping more robust.

This commit is contained in:
Arthur Britto
2012-06-16 12:18:02 -07:00
parent 160c625216
commit d6ca0389c9
2 changed files with 7 additions and 4 deletions

View File

@@ -70,6 +70,11 @@ void Application::run()
//
mWallet.start();
//
// Set up UNL.
//
getUNL().nodeBootstrap();
//
// Allow peer connections.
//
@@ -122,8 +127,6 @@ void Application::run()
mNetOps.setStateTimer(0);
getUNL().nodeBootstrap();
mIOService.run(); // This blocks
std::cout << "Done." << std::endl;

View File

@@ -1503,10 +1503,10 @@ void UniqueNodeList::nodeBootstrap()
ScopedLock sl(theApp->getWalletDB()->getDBLock());
if (db->executeSQL("SELECT COUNT(*) AS Count FROM SeedDomains;") && db->startIterRows())
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");
if (db->executeSQL("SELECT COUNT(*) AS Count FROM SeedNodes;") && db->startIterRows())
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");
}