aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-03-06 18:06:50 -0500
committerMarcoFalke <falke.marco@gmail.com>2020-03-10 09:47:32 -0400
commitfadafb83cff9a9a340eac1b5a853e2467d5e0ef7 (patch)
tree62583dfe70fc70cfde198ca12c1872ef79adc5a6 /src/init.cpp
parentfa70ccc6c4e304646b4610228f3975b3a9762643 (diff)
scheduler: Make schedule* methods type safe
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp
index a637aac4d2..eaabcf7382 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -86,8 +86,8 @@ static const bool DEFAULT_PROXYRANDOMIZE = true;
static const bool DEFAULT_REST_ENABLE = false;
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
-// Dump addresses to banlist.dat every 15 minutes (900s)
-static constexpr int DUMP_BANS_INTERVAL = 60 * 15;
+// How often to dump addresses to banlist.dat
+static constexpr std::chrono::minutes DUMP_BANS_INTERVAL{15};
#ifdef WIN32
@@ -1278,7 +1278,7 @@ bool AppInitMain(NodeContext& node)
// Gather some entropy once per minute.
node.scheduler->scheduleEvery([]{
RandAddPeriodic();
- }, 60000);
+ }, std::chrono::minutes{1});
GetMainSignals().RegisterBackgroundSignalScheduler(*node.scheduler);
@@ -1863,7 +1863,7 @@ bool AppInitMain(NodeContext& node)
BanMan* banman = node.banman.get();
node.scheduler->scheduleEvery([banman]{
banman->DumpBanlist();
- }, DUMP_BANS_INTERVAL * 1000);
+ }, DUMP_BANS_INTERVAL);
return true;
}