Bitcoin
Classes | Functions | Variables
validationinterface.cpp File Reference
#include <validationinterface.h>
#include <primitives/block.h>
#include <scheduler.h>
#include <txmempool.h>
#include <list>
#include <atomic>
#include <future>
#include <utility>
#include <boost/signals2/signal.hpp>

Classes

struct  ValidationInterfaceConnections
 
struct  MainSignalsInstance
 

Functions

CMainSignalsGetMainSignals ()
 
void RegisterValidationInterface (CValidationInterface *pwalletIn)
 
void UnregisterValidationInterface (CValidationInterface *pwalletIn)
 
void UnregisterAllValidationInterfaces ()
 
void CallFunctionInValidationInterfaceQueue (std::function< void()> func)
 
void SyncWithValidationInterfaceQueue ()
 

Variables

static CMainSignals g_signals
 
static std::unordered_map< CTxMemPool *, boost::signals2::scoped_connection > g_connNotifyEntryRemoved
 

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).

◆ GetMainSignals()

CMainSignals& GetMainSignals ( )

◆ RegisterValidationInterface()

void RegisterValidationInterface ( CValidationInterface pwalletIn)

Register a wallet to receive updates from core

◆ 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();

◆ UnregisterAllValidationInterfaces()

void UnregisterAllValidationInterfaces ( )

Unregister all wallets from core

◆ UnregisterValidationInterface()

void UnregisterValidationInterface ( CValidationInterface pwalletIn)

Unregister a wallet from core

Variable Documentation

◆ g_connNotifyEntryRemoved

std::unordered_map<CTxMemPool*, boost::signals2::scoped_connection> g_connNotifyEntryRemoved
static

◆ g_signals

CMainSignals g_signals
static