Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <validationinterface.h>
#include <init.h>
#include <primitives/block.h>
#include <scheduler.h>
#include <sync.h>
#include <txmempool.h>
#include <util.h>
#include <validation.h>
#include <list>
#include <atomic>
#include <future>
#include <boost/signals2/signal.hpp>
Go to the source code of this file.
Classes | |
struct | MainSignalsInstance |
Functions | |
CMainSignals & | GetMainSignals () |
void | RegisterValidationInterface (CValidationInterface *pwalletIn) |
Register a wallet to receive updates from core. More... | |
void | UnregisterValidationInterface (CValidationInterface *pwalletIn) |
Unregister a wallet from core. More... | |
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... | |
Variables | |
static CMainSignals | g_signals |
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 150 of file validationinterface.cpp.
References g_signals, and CMainSignals::m_internals.
Referenced by sendrawtransaction(), and SyncWithValidationInterfaceQueue().
◆ GetMainSignals()
CMainSignals& GetMainSignals | ( | ) |
Definition at line 79 of file validationinterface.cpp.
References g_signals.
Referenced by CChainState::AcceptBlock(), CChainState::AcceptBlockHeader(), AcceptToMemoryPoolWorker(), CChainState::ActivateBestChain(), CGovernanceManager::AddGovernanceObject(), AppInitMain(), CChainState::ConnectTip(), CChainState::DisconnectTip(), llmq::CChainLocksHandler::EnforceBestChainLock(), FlushStateToDisk(), CChainState::InvalidateBlock(), NotifyHeaderTip(), PrepareShutdown(), CDeterministicMNManager::ProcessBlock(), CGovernanceManager::ProcessMessage(), ProcessNewBlock(), PeerLogicValidation::SendMessages(), CDeterministicMNManager::UndoBlock(), and llmq::CInstantSendManager::UpdateWalletTransaction().
◆ RegisterValidationInterface()
void RegisterValidationInterface | ( | CValidationInterface * | pwalletIn | ) |
Register a wallet to receive updates from core.
Definition at line 84 of file validationinterface.cpp.
References CValidationInterface::AcceptedBlockHeader(), CValidationInterface::BlockChecked(), CValidationInterface::BlockConnected(), CValidationInterface::BlockDisconnected(), g_signals, CMainSignals::m_internals, CValidationInterface::NewPoWValidBlock(), CValidationInterface::NotifyChainLock(), CValidationInterface::NotifyGovernanceObject(), CValidationInterface::NotifyGovernanceVote(), CValidationInterface::NotifyHeaderTip(), CValidationInterface::NotifyInstantSendDoubleSpendAttempt(), CValidationInterface::NotifyMasternodeListChanged(), CValidationInterface::NotifyTransactionLock(), CValidationInterface::ResendWalletTransactions(), CValidationInterface::SetBestChain(), CValidationInterface::SynchronousUpdatedBlockTip(), CValidationInterface::TransactionAddedToMempool(), CValidationInterface::TransactionRemovedFromMempool(), and CValidationInterface::UpdatedBlockTip().
Referenced by AppInitMain(), CWallet::CreateWalletFromFile(), submitblock(), and WalletTestingSetup::WalletTestingSetup().
◆ 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 154 of file validationinterface.cpp.
References AssertLockNotHeld, CallFunctionInValidationInterfaceQueue(), and cs_main.
Referenced by CChainState::ActivateBestChain(), and CWallet::BlockUntilSyncedToCurrentChain().
◆ UnregisterAllValidationInterfaces()
void UnregisterAllValidationInterfaces | ( | ) |
Unregister all wallets from core.
Definition at line 126 of file validationinterface.cpp.
References g_signals, and CMainSignals::m_internals.
Referenced by PrepareShutdown().
◆ UnregisterValidationInterface()
void UnregisterValidationInterface | ( | CValidationInterface * | pwalletIn | ) |
Unregister a wallet from core.
Definition at line 105 of file validationinterface.cpp.
References CValidationInterface::AcceptedBlockHeader(), CValidationInterface::BlockChecked(), CValidationInterface::BlockConnected(), CValidationInterface::BlockDisconnected(), g_signals, CMainSignals::m_internals, CValidationInterface::NewPoWValidBlock(), CValidationInterface::NotifyChainLock(), CValidationInterface::NotifyGovernanceObject(), CValidationInterface::NotifyGovernanceVote(), CValidationInterface::NotifyHeaderTip(), CValidationInterface::NotifyInstantSendDoubleSpendAttempt(), CValidationInterface::NotifyMasternodeListChanged(), CValidationInterface::NotifyTransactionLock(), CValidationInterface::ResendWalletTransactions(), CValidationInterface::SetBestChain(), CValidationInterface::SynchronousUpdatedBlockTip(), CValidationInterface::TransactionAddedToMempool(), CValidationInterface::TransactionRemovedFromMempool(), and CValidationInterface::UpdatedBlockTip().
Referenced by PrepareShutdown(), submitblock(), and WalletTestingSetup::~WalletTestingSetup().
Variable Documentation
◆ g_signals
|
static |
Definition at line 49 of file validationinterface.cpp.
Referenced by CallFunctionInValidationInterfaceQueue(), GetMainSignals(), RegisterValidationInterface(), UnregisterAllValidationInterfaces(), and UnregisterValidationInterface().