18 #include <boost/signals2/signal.hpp> 21 boost::signals2::signal<void (const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)>
UpdatedBlockTip;
23 boost::signals2::signal<void (const std::shared_ptr<const CBlock> &,
const CBlockIndex *pindex,
const std::vector<CTransactionRef>&)>
BlockConnected;
27 boost::signals2::signal<void (int64_t nBestBlockTime, CConnman* connman)>
Broadcast;
28 boost::signals2::signal<void (const CBlock&, const CValidationState&)>
BlockChecked;
29 boost::signals2::signal<void (const CBlockIndex *, const std::shared_ptr<const CBlock>&)>
NewPoWValidBlock;
30 boost::signals2::signal<void (const uint256 &)>
BlockFound;
59 return m_internals->m_schedulerClient.CallbacksPending();
105 g_signals.
m_internals->BlockChecked.disconnect_all_slots();
106 g_signals.
m_internals->Broadcast.disconnect_all_slots();
107 g_signals.
m_internals->ChainStateFlushed.disconnect_all_slots();
108 g_signals.
m_internals->TransactionAddedToMempool.disconnect_all_slots();
109 g_signals.
m_internals->BlockConnected.disconnect_all_slots();
110 g_signals.
m_internals->BlockDisconnected.disconnect_all_slots();
111 g_signals.
m_internals->TransactionRemovedFromMempool.disconnect_all_slots();
112 g_signals.
m_internals->UpdatedBlockTip.disconnect_all_slots();
113 g_signals.
m_internals->NewPoWValidBlock.disconnect_all_slots();
114 g_signals.
m_internals->BlockFound.disconnect_all_slots();
118 g_signals.
m_internals->m_schedulerClient.AddToProcessQueue(std::move(func));
124 std::promise<void> promise;
128 promise.get_future().wait();
133 m_internals->m_schedulerClient.AddToProcessQueue([ptx,
this] {
144 m_internals->m_schedulerClient.AddToProcessQueue([pindexNew, pindexFork, fInitialDownload,
this] {
145 m_internals->UpdatedBlockTip(pindexNew, pindexFork, fInitialDownload);
150 m_internals->m_schedulerClient.AddToProcessQueue([ptx,
this] {
156 m_internals->m_schedulerClient.AddToProcessQueue([pblock, pindex, pvtxConflicted,
this] {
157 m_internals->BlockConnected(pblock, pindex, *pvtxConflicted);
162 m_internals->m_schedulerClient.AddToProcessQueue([pblock,
this] {
168 m_internals->m_schedulerClient.AddToProcessQueue([locator,
this] {
void UpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)
Class used by CScheduler clients which may schedule multiple jobs which are required to be run serial...
boost::signals2::signal< void(const CTransactionRef &)> TransactionAddedToMempool
std::unique_ptr< MainSignalsInstance > m_internals
virtual void ChainStateFlushed(const CBlockLocator &locator)
Notifies listeners of the new active block chain on-disk.
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...
virtual void BlockChecked(const CBlock &, const CValidationState &)
Notifies listeners of a block validation result.
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
boost::signals2::signal< void(const std::shared_ptr< const CBlock > &, const CBlockIndex *pindex, const std::vector< CTransactionRef > &)> BlockConnected
virtual void ResendWalletTransactions(int64_t nBestBlockTime, CConnman *connman)
Tells listeners to broadcast their data.
virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &block)
Notifies listeners that a block which builds directly on our current tip has been received and connec...
boost::signals2::signal< void(const CBlock &, const CValidationState &)> BlockChecked
void BlockFound(const uint256 &)
size_t CallbacksPending()
void UnregisterBackgroundSignalScheduler()
Unregister a CScheduler to give callbacks which should run in the background - these callbacks will n...
MemPoolRemovalReason
Reason why a transaction was removed from the mempool, this is passed to the notification signal...
void UnregisterAllValidationInterfaces()
Unregister all wallets from core.
void UnregisterValidationInterface(CValidationInterface *pwalletIn)
Unregister a wallet from core.
void Broadcast(int64_t nBestBlockTime, CConnman *connman)
void BlockChecked(const CBlock &, const CValidationState &)
std::shared_ptr< const CTransaction > CTransactionRef
Implement this to subscribe to events generated in validation.
virtual void BlockDisconnected(const std::shared_ptr< const CBlock > &block)
Notifies listeners of a block being disconnected.
Removed for conflict with in-block transaction.
SingleThreadedSchedulerClient m_schedulerClient
MainSignalsInstance(CScheduler *pscheduler)
boost::signals2::signal< void(const CBlockIndex *, const std::shared_ptr< const CBlock > &)> NewPoWValidBlock
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload)
Notifies listeners when the block chain tip advances.
void RegisterWithMempoolSignals(CTxMemPool &pool)
Register with mempool to call TransactionRemovedFromMempool callbacks.
CMainSignals & GetMainSignals()
void UnregisterWithMempoolSignals(CTxMemPool &pool)
Unregister with mempool.
void CallFunctionInValidationInterfaceQueue(std::function< void()> func)
Pushes a function to callback onto the notification queue, guaranteeing any callbacks generated prior...
void ChainStateFlushed(const CBlockLocator &)
void RegisterValidationInterface(CValidationInterface *pwalletIn)
Register a wallet to receive updates from core.
virtual void BlockFound(const uint256 &hash)
void RegisterBackgroundSignalScheduler(CScheduler &scheduler)
Register a CScheduler to give callbacks which should run in the background (may only be called once) ...
Capture information about block/transaction validation.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
The block chain is a tree shaped structure starting with the genesis block at the root...
void FlushBackgroundCallbacks()
Call any remaining callbacks on the calling thread.
void MempoolEntryRemoved(CTransactionRef tx, MemPoolRemovalReason reason)
boost::signals2::signal< void(const uint256 &)> BlockFound
virtual void TransactionRemovedFromMempool(const CTransactionRef &ptx)
Notifies listeners of a transaction leaving mempool.
boost::signals2::signal< void(const std::shared_ptr< const CBlock > &)> BlockDisconnected
#define AssertLockNotHeld(cs)
virtual void TransactionAddedToMempool(const CTransactionRef &ptxn)
Notifies listeners of a transaction having been added to mempool.
boost::signals2::signal< void(const CBlockLocator &)> ChainStateFlushed
virtual void BlockConnected(const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex, const std::vector< CTransactionRef > &txnConflicted)
Notifies listeners of a block being connected.
boost::signals2::signal< void(CTransactionRef, MemPoolRemovalReason)> NotifyEntryRemoved
void BlockDisconnected(const std::shared_ptr< const CBlock > &)
boost::signals2::signal< void(const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)> UpdatedBlockTip
void NewPoWValidBlock(const CBlockIndex *, const std::shared_ptr< const CBlock > &)
boost::signals2::signal< void(int64_t nBestBlockTime, CConnman *connman)> Broadcast
boost::signals2::signal< void(const CTransactionRef &)> TransactionRemovedFromMempool
void BlockConnected(const std::shared_ptr< const CBlock > &, const CBlockIndex *pindex, const std::shared_ptr< const std::vector< CTransactionRef >> &)
void TransactionAddedToMempool(const CTransactionRef &)