Changeset View
Changeset View
Standalone View
Standalone View
src/validationinterface.h
Show All 14 Lines | |||||
struct CBlockLocator; | struct CBlockLocator; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CConnman; | class CConnman; | ||||
class CReserveScript; | class CReserveScript; | ||||
class CValidationInterface; | class CValidationInterface; | ||||
class CValidationState; | class CValidationState; | ||||
class uint256; | class uint256; | ||||
class CScheduler; | class CScheduler; | ||||
class CTxMemPool; | |||||
enum class MemPoolRemovalReason; | |||||
// These functions dispatch to one or all registered wallets | // These functions dispatch to one or all registered wallets | ||||
/** Register a wallet to receive updates from core */ | /** Register a wallet to receive updates from core */ | ||||
void RegisterValidationInterface(CValidationInterface *pwalletIn); | void RegisterValidationInterface(CValidationInterface *pwalletIn); | ||||
/** Unregister a wallet from core */ | /** Unregister a wallet from core */ | ||||
void UnregisterValidationInterface(CValidationInterface *pwalletIn); | void UnregisterValidationInterface(CValidationInterface *pwalletIn); | ||||
/** Unregister all wallets from core */ | /** Unregister all wallets from core */ | ||||
Show All 17 Lines | virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, | ||||
bool fInitialDownload) {} | bool fInitialDownload) {} | ||||
/** | /** | ||||
* Notifies listeners of a transaction having been added to mempool. | * Notifies listeners of a transaction having been added to mempool. | ||||
* | * | ||||
* Called on a background thread. | * Called on a background thread. | ||||
*/ | */ | ||||
virtual void TransactionAddedToMempool(const CTransactionRef &ptxn) {} | virtual void TransactionAddedToMempool(const CTransactionRef &ptxn) {} | ||||
/** | /** | ||||
* Notifies listeners of a transaction leaving mempool. | |||||
* | |||||
* This only fires for transactions which leave mempool because of expiry, | |||||
* size limiting, reorg (changes in lock times/coinbase maturity), or | |||||
* replacement. This does not include any transactions which are included | |||||
* in BlockConnectedDisconnected either in block->vtx or in txnConflicted. | |||||
*/ | |||||
virtual void TransactionRemovedFromMempool(const CTransactionRef &ptx) {} | |||||
/** | |||||
* Notifies listeners of a block being connected. | * Notifies listeners of a block being connected. | ||||
* Provides a vector of transactions evicted from the mempool as a result. | * Provides a vector of transactions evicted from the mempool as a result. | ||||
*/ | */ | ||||
virtual void | virtual void | ||||
BlockConnected(const std::shared_ptr<const CBlock> &block, | BlockConnected(const std::shared_ptr<const CBlock> &block, | ||||
const CBlockIndex *pindex, | const CBlockIndex *pindex, | ||||
const std::vector<CTransactionRef> &txnConflicted) {} | const std::vector<CTransactionRef> &txnConflicted) {} | ||||
/** Notifies listeners of a block being disconnected */ | /** Notifies listeners of a block being disconnected */ | ||||
Show All 29 Lines | |||||
class CMainSignals { | class CMainSignals { | ||||
private: | private: | ||||
std::unique_ptr<MainSignalsInstance> m_internals; | std::unique_ptr<MainSignalsInstance> m_internals; | ||||
friend void ::RegisterValidationInterface(CValidationInterface *); | friend void ::RegisterValidationInterface(CValidationInterface *); | ||||
friend void ::UnregisterValidationInterface(CValidationInterface *); | friend void ::UnregisterValidationInterface(CValidationInterface *); | ||||
friend void ::UnregisterAllValidationInterfaces(); | friend void ::UnregisterAllValidationInterfaces(); | ||||
void MempoolEntryRemoved(CTransactionRef tx, MemPoolRemovalReason reason); | |||||
public: | public: | ||||
/** | /** | ||||
* Register a CScheduler to give callbacks which should run in the | * Register a CScheduler to give callbacks which should run in the | ||||
* background (may only be called once) | * background (may only be called once) | ||||
*/ | */ | ||||
void RegisterBackgroundSignalScheduler(CScheduler &scheduler); | void RegisterBackgroundSignalScheduler(CScheduler &scheduler); | ||||
/** | /** | ||||
* Unregister a CScheduler to give callbacks which should run in the | * Unregister a CScheduler to give callbacks which should run in the | ||||
* background - these callbacks will now be dropped! | * background - these callbacks will now be dropped! | ||||
*/ | */ | ||||
void UnregisterBackgroundSignalScheduler(); | void UnregisterBackgroundSignalScheduler(); | ||||
/** Call any remaining callbacks on the calling thread */ | /** Call any remaining callbacks on the calling thread */ | ||||
void FlushBackgroundCallbacks(); | void FlushBackgroundCallbacks(); | ||||
/** Register with mempool to call TransactionRemovedFromMempool callbacks */ | |||||
void RegisterWithMempoolSignals(CTxMemPool &pool); | |||||
/** Unregister with mempool */ | |||||
void UnregisterWithMempoolSignals(CTxMemPool &pool); | |||||
void UpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, | void UpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, | ||||
bool fInitialDownload); | bool fInitialDownload); | ||||
void TransactionAddedToMempool(const CTransactionRef &); | void TransactionAddedToMempool(const CTransactionRef &); | ||||
void BlockConnected(const std::shared_ptr<const CBlock> &, | void BlockConnected(const std::shared_ptr<const CBlock> &, | ||||
const CBlockIndex *pindex, | const CBlockIndex *pindex, | ||||
const std::vector<CTransactionRef> &); | const std::vector<CTransactionRef> &); | ||||
void BlockDisconnected(const std::shared_ptr<const CBlock> &); | void BlockDisconnected(const std::shared_ptr<const CBlock> &); | ||||
void SetBestChain(const CBlockLocator &); | void SetBestChain(const CBlockLocator &); | ||||
Show All 10 Lines |