Changeset View
Changeset View
Standalone View
Standalone View
src/validationinterface.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#include <scheduler.h> | #include <scheduler.h> | ||||
#include <txmempool.h> | #include <txmempool.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <boost/signals2/signal.hpp> | |||||
#include <atomic> | #include <atomic> | ||||
#include <future> | #include <future> | ||||
#include <list> | #include <list> | ||||
#include <utility> | |||||
#include <tuple> | |||||
#include <boost/signals2/signal.hpp> | |||||
struct ValidationInterfaceConnections { | struct ValidationInterfaceConnections { | ||||
boost::signals2::scoped_connection UpdatedBlockTip; | boost::signals2::scoped_connection UpdatedBlockTip; | ||||
boost::signals2::scoped_connection TransactionAddedToMempool; | boost::signals2::scoped_connection TransactionAddedToMempool; | ||||
boost::signals2::scoped_connection BlockConnected; | boost::signals2::scoped_connection BlockConnected; | ||||
boost::signals2::scoped_connection BlockDisconnected; | boost::signals2::scoped_connection BlockDisconnected; | ||||
boost::signals2::scoped_connection TransactionRemovedFromMempool; | boost::signals2::scoped_connection TransactionRemovedFromMempool; | ||||
boost::signals2::scoped_connection ChainStateFlushed; | boost::signals2::scoped_connection ChainStateFlushed; | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | size_t CMainSignals::CallbacksPending() { | ||||
if (!m_internals) { | if (!m_internals) { | ||||
return 0; | return 0; | ||||
} | } | ||||
return m_internals->m_schedulerClient.CallbacksPending(); | return m_internals->m_schedulerClient.CallbacksPending(); | ||||
} | } | ||||
void CMainSignals::RegisterWithMempoolSignals(CTxMemPool &pool) { | void CMainSignals::RegisterWithMempoolSignals(CTxMemPool &pool) { | ||||
g_connNotifyEntryRemoved.emplace( | g_connNotifyEntryRemoved.emplace( | ||||
&pool, pool.NotifyEntryRemoved.connect( | std::piecewise_construct, std::forward_as_tuple(&pool), | ||||
std::forward_as_tuple(pool.NotifyEntryRemoved.connect( | |||||
std::bind(&CMainSignals::MempoolEntryRemoved, this, | std::bind(&CMainSignals::MempoolEntryRemoved, this, | ||||
std::placeholders::_1, std::placeholders::_2))); | std::placeholders::_1, std::placeholders::_2)))); | ||||
} | } | ||||
void CMainSignals::UnregisterWithMempoolSignals(CTxMemPool &pool) { | void CMainSignals::UnregisterWithMempoolSignals(CTxMemPool &pool) { | ||||
g_connNotifyEntryRemoved.erase(&pool); | g_connNotifyEntryRemoved.erase(&pool); | ||||
} | } | ||||
CMainSignals &GetMainSignals() { | CMainSignals &GetMainSignals() { | ||||
return g_signals; | return g_signals; | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |