Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
validationinterface.cpp File Reference
#include <validationinterface.h>
#include <attributes.h>
#include <chain.h>
#include <consensus/validation.h>
#include <logging.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <scheduler.h>
#include <future>
#include <tuple>
#include <unordered_map>
#include <utility>
Include dependency graph for validationinterface.cpp:

Go to the source code of this file.

Classes

class  MainSignalsImpl
 MainSignalsImpl manages a list of shared_ptr<CValidationInterface> callbacks. More...
 
struct  MainSignalsImpl::ListEntry
 List entries consist of a callback pointer and reference count. More...
 

Macros

#define ENQUEUE_AND_LOG_EVENT(event, fmt, name, ...)
 
#define LOG_EVENT(fmt, ...)   LogPrint(BCLog::VALIDATION, fmt "\n", __VA_ARGS__)
 

Functions

const std::string RemovalReasonToString (const MemPoolRemovalReason &r) noexcept
 
CMainSignalsGetMainSignals ()
 
void RegisterSharedValidationInterface (std::shared_ptr< CValidationInterface > callbacks)
 Register subscriber.
 
void RegisterValidationInterface (CValidationInterface *callbacks)
 Register subscriber.
 
void UnregisterSharedValidationInterface (std::shared_ptr< CValidationInterface > callbacks)
 Unregister subscriber.
 
void UnregisterValidationInterface (CValidationInterface *callbacks)
 Unregister subscriber.
 
void UnregisterAllValidationInterfaces ()
 Unregister all subscribers.
 
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.
 
void 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();.
 

Variables

static CMainSignals g_signals
 

Macro Definition Documentation

◆ ENQUEUE_AND_LOG_EVENT

#define ENQUEUE_AND_LOG_EVENT (   event,
  fmt,
  name,
  ... 
)
Value:
do { \
auto local_name = (name); \
m_internals->m_schedulerClient.AddToProcessQueue([=] { \
event(); \
}); \
} while (0)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
const char * name
Definition rest.cpp:47

Definition at line 182 of file validationinterface.cpp.

◆ LOG_EVENT

#define LOG_EVENT (   fmt,
  ... 
)    LogPrint(BCLog::VALIDATION, fmt "\n", __VA_ARGS__)

Definition at line 192 of file validationinterface.cpp.

Function Documentation

◆ CallFunctionInValidationInterfaceQueue()

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.

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 166 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ GetMainSignals()

CMainSignals & GetMainSignals ( )

Definition at line 130 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ RegisterSharedValidationInterface()

void RegisterSharedValidationInterface ( std::shared_ptr< CValidationInterface callbacks)

Register subscriber.

Definition at line 134 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ RegisterValidationInterface()

void RegisterValidationInterface ( CValidationInterface callbacks)

Register subscriber.

Definition at line 141 of file validationinterface.cpp.

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

◆ RemovalReasonToString()

const std::string RemovalReasonToString ( const MemPoolRemovalReason r)
noexcept

Definition at line 822 of file txmempool.cpp.

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

◆ SyncWithValidationInterfaceQueue()

void 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 170 of file validationinterface.cpp.

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

◆ UnregisterAllValidationInterfaces()

void UnregisterAllValidationInterfaces ( )

Unregister all subscribers.

Definition at line 159 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ UnregisterSharedValidationInterface()

void UnregisterSharedValidationInterface ( std::shared_ptr< CValidationInterface callbacks)

Unregister subscriber.

Definition at line 148 of file validationinterface.cpp.

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

◆ UnregisterValidationInterface()

void 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 153 of file validationinterface.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ g_signals

CMainSignals g_signals
static

Definition at line 106 of file validationinterface.cpp.