Bitcoin
|
Go to the source code of this file.
Classes | |
class | CValidationInterface |
class | CMainSignals |
Functions | |
void | RegisterValidationInterface (CValidationInterface *pwalletIn) |
void | UnregisterValidationInterface (CValidationInterface *pwalletIn) |
void | UnregisterAllValidationInterfaces () |
void | CallFunctionInValidationInterfaceQueue (std::function< void()> func) |
void | SyncWithValidationInterfaceQueue () LOCKS_EXCLUDED(cs_main) |
CMainSignals & | GetMainSignals () |
Variables | |
CCriticalSection | cs_main |
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).
CMainSignals& GetMainSignals | ( | ) |
void RegisterValidationInterface | ( | CValidationInterface * | pwalletIn | ) |
Register a wallet to receive updates from core
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();
void UnregisterAllValidationInterfaces | ( | ) |
Unregister all wallets from core
void UnregisterValidationInterface | ( | CValidationInterface * | pwalletIn | ) |
Unregister a wallet from core
CCriticalSection cs_main |
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
This may also need to be locked when updating the transaction pool, e.g. on AcceptToMemoryPool. See CTxMemPool::cs comment for details.
The transaction pool has a separate lock to allow reading from it and the chainstate at the same time.