PIVX Core  5.6.99
P2P Digital Currency
Classes | Macros | Functions
validationinterface.cpp File Reference
#include "validationinterface.h"
#include "chain.h"
#include "consensus/validation.h"
#include "evo/deterministicmns.h"
#include "logging.h"
#include "scheduler.h"
#include "util/validation.h"
#include "validation.h"
#include <future>
#include <list>
#include <unordered_map>
#include <boost/signals2/signal.hpp>
Include dependency graph for validationinterface.cpp:

Go to the source code of this file.

Classes

struct  ValidationInterfaceConnections
 
struct  MainSignalsInstance
 

Macros

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

Functions

CMainSignalsGetMainSignals ()
 
void RegisterSharedValidationInterface (std::shared_ptr< CValidationInterface > pwalletIn)
 
void RegisterValidationInterface (CValidationInterface *pwalletIn)
 Register a wallet to receive updates from core. More...
 
void UnregisterValidationInterface (CValidationInterface *pwalletIn)
 Unregister a wallet from core. More...
 
void UnregisterSharedValidationInterface (std::shared_ptr< CValidationInterface > pwalletIn)
 
void UnregisterAllValidationInterfaces ()
 Unregister all wallets from core. 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 ()
 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...
 

Macro Definition Documentation

◆ ENQUEUE_AND_LOG_EVENT

#define ENQUEUE_AND_LOG_EVENT (   event,
  fmt,
  name,
  ... 
)
Value:
do { \
auto local_name = (name); \
LOG_EVENT("Enqueuing " fmt, local_name, __VA_ARGS__); \
m_internals->m_schedulerClient.AddToProcessQueue([=] { \
LOG_EVENT(fmt, local_name, __VA_ARGS__); \
event(); \
}); \
} while (0)
const char * name
Definition: rest.cpp:37

Definition at line 160 of file validationinterface.cpp.

◆ LOG_EVENT

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

Definition at line 170 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 139 of file validationinterface.cpp.

◆ GetMainSignals()

CMainSignals& GetMainSignals ( )

Definition at line 92 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ RegisterSharedValidationInterface()

void RegisterSharedValidationInterface ( std::shared_ptr< CValidationInterface pwalletIn)

Definition at line 96 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ RegisterValidationInterface()

void RegisterValidationInterface ( CValidationInterface pwalletIn)

Register a wallet to receive updates from core.

Definition at line 112 of file validationinterface.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 143 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ UnregisterAllValidationInterfaces()

void UnregisterAllValidationInterfaces ( )

Unregister all wallets from core.

Definition at line 131 of file validationinterface.cpp.

Here is the caller graph for this function:

◆ UnregisterSharedValidationInterface()

void UnregisterSharedValidationInterface ( std::shared_ptr< CValidationInterface pwalletIn)

Definition at line 126 of file validationinterface.cpp.

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

◆ UnregisterValidationInterface()

void UnregisterValidationInterface ( CValidationInterface pwalletIn)

Unregister a wallet from core.

Definition at line 119 of file validationinterface.cpp.

Here is the caller graph for this function: