aboutsummaryrefslogtreecommitdiff
path: root/src/validationinterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/validationinterface.cpp')
-rw-r--r--src/validationinterface.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index 7d0ab756e8..a17a08eee2 100644
--- a/src/validationinterface.cpp
+++ b/src/validationinterface.cpp
@@ -4,6 +4,8 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "validationinterface.h"
+#include "init.h"
+#include "scheduler.h"
#include <boost/signals2/signal.hpp>
@@ -17,6 +19,8 @@ struct MainSignalsInstance {
boost::signals2::signal<void (int64_t nBestBlockTime, CConnman* connman)> Broadcast;
boost::signals2::signal<void (const CBlock&, const CValidationState&)> BlockChecked;
boost::signals2::signal<void (const CBlockIndex *, const std::shared_ptr<const CBlock>&)> NewPoWValidBlock;
+
+ CScheduler *m_scheduler = NULL;
};
static CMainSignals g_signals;
@@ -25,6 +29,15 @@ CMainSignals::CMainSignals() {
m_internals.reset(new MainSignalsInstance());
}
+void CMainSignals::RegisterBackgroundSignalScheduler(CScheduler& scheduler) {
+ assert(!m_internals->m_scheduler);
+ m_internals->m_scheduler = &scheduler;
+}
+
+void CMainSignals::UnregisterBackgroundSignalScheduler() {
+ m_internals->m_scheduler = NULL;
+}
+
CMainSignals& GetMainSignals()
{
return g_signals;