aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2015-04-02 12:04:59 -0400
committerGavin Andresen <[email protected]>2015-05-14 12:50:42 -0400
commit9a1dcea2df2a6a89acf79bc41972e937d783a080 (patch)
treea442b42c60df35d3e95d313ba08a47a2a793af8d /src/net.cpp
parentCreate a scheduler thread for lightweight tasks (diff)
downloaddiscoin-9a1dcea2df2a6a89acf79bc41972e937d783a080.tar.xz
discoin-9a1dcea2df2a6a89acf79bc41972e937d783a080.zip
Use CScheduler for net's DumpAddresses
Instead of starting Yet Another Thread to dump addresses, use CScheduler to do it.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 2de04fc57..6849d7926 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -13,6 +13,7 @@
#include "chainparams.h"
#include "clientversion.h"
#include "primitives/transaction.h"
+#include "scheduler.h"
#include "ui_interface.h"
#include "crypto/common.h"
@@ -1590,7 +1591,7 @@ void static Discover(boost::thread_group& threadGroup)
#endif
}
-void StartNode(boost::thread_group& threadGroup)
+void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
{
uiInterface.InitMessage(_("Loading addresses..."));
// Load addresses for peers.dat
@@ -1640,7 +1641,7 @@ void StartNode(boost::thread_group& threadGroup)
threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "msghand", &ThreadMessageHandler));
// Dump network addresses
- threadGroup.create_thread(boost::bind(&LoopForever<void (*)()>, "dumpaddr", &DumpAddresses, DUMP_ADDRESSES_INTERVAL * 1000));
+ scheduler.scheduleEvery(&DumpAddresses, DUMP_ADDRESSES_INTERVAL);
}
bool StopNode()