Bitcoin ABC 0.33.11
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
ValidationSignals Class Reference

#include <validationinterface.h>

Public Member Functions

 ValidationSignals (std::unique_ptr< util::TaskRunnerInterface > task_runner)
 
 ~ValidationSignals ()
 
void FlushBackgroundCallbacks ()
 Call any remaining callbacks on the calling thread. More...
 
size_t CallbacksPending ()
 
void RegisterValidationInterface (CValidationInterface *callbacks)
 Register subscriber. More...
 
void UnregisterValidationInterface (CValidationInterface *callbacks)
 Unregister subscriber. More...
 
void UnregisterAllValidationInterfaces ()
 Unregister all subscribers. More...
 
void RegisterSharedValidationInterface (std::shared_ptr< CValidationInterface > callbacks)
 Register subscriber. More...
 
void UnregisterSharedValidationInterface (std::shared_ptr< CValidationInterface > callbacks)
 Unregister subscriber. More...
 
void CallFunctionInValidationInterfaceQueue (std::function< void()> func)
 Pushes a function to callback onto the notification queue, guaranteeing any callbacks generated prior to now are finished when the function is called. More...
 
void SyncWithValidationInterfaceQueue () LOCKS_EXCLUDED(cs_main)
 This is a synonym for the following, which asserts certain locks are not held: std::promise<void> promise; CallFunctionInValidationInterfaceQueue([&promise] { promise.set_value(); }); promise.get_future().wait();. More...
 
void UpdatedBlockTip (const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)
 
void TransactionAddedToMempool (const CTransactionRef &, std::shared_ptr< const std::vector< Coin > >, uint64_t mempool_sequence)
 
void TransactionRemovedFromMempool (const CTransactionRef &, MemPoolRemovalReason, uint64_t mempool_sequence)
 
void BlockConnected (ChainstateRole, const std::shared_ptr< const CBlock > &, const CBlockIndex *pindex)
 
void BlockDisconnected (const std::shared_ptr< const CBlock > &, const CBlockIndex *pindex)
 
void ChainStateFlushed (ChainstateRole, const CBlockLocator &)
 
void BlockChecked (const CBlock &, const BlockValidationState &)
 
void NewPoWValidBlock (const CBlockIndex *, const std::shared_ptr< const CBlock > &)
 
void BlockFinalized (const CBlockIndex *pindex)
 
void BlockInvalidated (const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &block)
 
void TransactionFinalized (const CTransactionRef &tx)
 
void TransactionInvalidated (const CTransactionRef &tx, std::shared_ptr< const std::vector< Coin > > spent_coins)
 

Private Attributes

std::unique_ptr< ValidationSignalsImplm_internals
 

Detailed Description

Definition at line 174 of file validationinterface.h.

Constructor & Destructor Documentation

◆ ValidationSignals()

ValidationSignals::ValidationSignals ( std::unique_ptr< util::TaskRunnerInterface task_runner)
explicit

Definition at line 105 of file validationinterface.cpp.

◆ ~ValidationSignals()

ValidationSignals::~ValidationSignals ( )

Definition at line 110 of file validationinterface.cpp.

Member Function Documentation

◆ BlockChecked()

void ValidationSignals::BlockChecked ( const CBlock block,
const BlockValidationState state 
)

Definition at line 261 of file validationinterface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlockConnected()

void ValidationSignals::BlockConnected ( ChainstateRole  role,
const std::shared_ptr< const CBlock > &  pblock,
const CBlockIndex pindex 
)

Definition at line 226 of file validationinterface.cpp.

Here is the call graph for this function:

◆ BlockDisconnected()

void ValidationSignals::BlockDisconnected ( const std::shared_ptr< const CBlock > &  pblock,
const CBlockIndex pindex 
)

Definition at line 238 of file validationinterface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlockFinalized()

void ValidationSignals::BlockFinalized ( const CBlockIndex pindex)

Definition at line 278 of file validationinterface.cpp.

Here is the call graph for this function:

◆ BlockInvalidated()

void ValidationSignals::BlockInvalidated ( const CBlockIndex pindex,
const std::shared_ptr< const CBlock > &  block 
)

Definition at line 288 of file validationinterface.cpp.

Here is the call graph for this function:

◆ CallbacksPending()

size_t ValidationSignals::CallbacksPending ( )

Definition at line 116 of file validationinterface.cpp.

◆ CallFunctionInValidationInterfaceQueue()

void ValidationSignals::CallFunctionInValidationInterfaceQueue ( std::function< void()>  func)

Pushes a function to callback onto the notification queue, guaranteeing any callbacks generated prior to now are finished when the function is called.

Be very careful blocking on func to be called if any locks are held - validation interface clients may not be able to make progress as they often wait for things like cs_main, so blocking until func is called with cs_main will result in a deadlock (that DEBUG_LOCKORDER will miss).

Definition at line 149 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ ChainStateFlushed()

void ValidationSignals::ChainStateFlushed ( ChainstateRole  role,
const CBlockLocator locator 
)

Definition at line 249 of file validationinterface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FlushBackgroundCallbacks()

void ValidationSignals::FlushBackgroundCallbacks ( )

Call any remaining callbacks on the calling thread.

Definition at line 112 of file validationinterface.cpp.

◆ NewPoWValidBlock()

void ValidationSignals::NewPoWValidBlock ( const CBlockIndex pindex,
const std::shared_ptr< const CBlock > &  block 
)

Definition at line 270 of file validationinterface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterSharedValidationInterface()

void ValidationSignals::RegisterSharedValidationInterface ( std::shared_ptr< CValidationInterface callbacks)

Register subscriber.

Definition at line 120 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ RegisterValidationInterface()

void ValidationSignals::RegisterValidationInterface ( CValidationInterface callbacks)

Register subscriber.

Definition at line 127 of file validationinterface.cpp.

Here is the call graph for this function:

◆ SyncWithValidationInterfaceQueue()

void ValidationSignals::SyncWithValidationInterfaceQueue ( )

This is a synonym for the following, which asserts certain locks are not held: std::promise<void> promise; CallFunctionInValidationInterfaceQueue([&promise] { promise.set_value(); }); promise.get_future().wait();.

Definition at line 154 of file validationinterface.cpp.

Here is the call graph for this function:

◆ TransactionAddedToMempool()

void ValidationSignals::TransactionAddedToMempool ( const CTransactionRef tx,
std::shared_ptr< const std::vector< Coin > >  spent_coins,
uint64_t  mempool_sequence 
)

Definition at line 198 of file validationinterface.cpp.

Here is the call graph for this function:

◆ TransactionFinalized()

void ValidationSignals::TransactionFinalized ( const CTransactionRef tx)

Definition at line 299 of file validationinterface.cpp.

Here is the call graph for this function:

◆ TransactionInvalidated()

void ValidationSignals::TransactionInvalidated ( const CTransactionRef tx,
std::shared_ptr< const std::vector< Coin > >  spent_coins 
)

Definition at line 309 of file validationinterface.cpp.

Here is the call graph for this function:

◆ TransactionRemovedFromMempool()

void ValidationSignals::TransactionRemovedFromMempool ( const CTransactionRef tx,
MemPoolRemovalReason  reason,
uint64_t  mempool_sequence 
)

Definition at line 212 of file validationinterface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnregisterAllValidationInterfaces()

void ValidationSignals::UnregisterAllValidationInterfaces ( )

Unregister all subscribers.

Definition at line 145 of file validationinterface.cpp.

◆ UnregisterSharedValidationInterface()

void ValidationSignals::UnregisterSharedValidationInterface ( std::shared_ptr< CValidationInterface callbacks)

Unregister subscriber.

Definition at line 135 of file validationinterface.cpp.

Here is the call graph for this function:

◆ UnregisterValidationInterface()

void ValidationSignals::UnregisterValidationInterface ( CValidationInterface callbacks)

Unregister subscriber.

DEPRECATED. This is not safe to use when the RPC server or main message handler thread is running.

Definition at line 140 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ UpdatedBlockTip()

void ValidationSignals::UpdatedBlockTip ( const CBlockIndex pindexNew,
const CBlockIndex pindexFork,
bool  fInitialDownload 
)

Definition at line 178 of file validationinterface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_internals

std::unique_ptr<ValidationSignalsImpl> ValidationSignals::m_internals
private

Definition at line 176 of file validationinterface.h.


The documentation for this class was generated from the following files: