Changeset View
Changeset View
Standalone View
Standalone View
src/validationinterface.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_VALIDATIONINTERFACE_H | #ifndef BITCOIN_VALIDATIONINTERFACE_H | ||||
#define BITCOIN_VALIDATIONINTERFACE_H | #define BITCOIN_VALIDATIONINTERFACE_H | ||||
#include <primitives/transaction.h> // CTransaction(Ref) | #include <primitives/transaction.h> // CTransaction(Ref) | ||||
#include <sync.h> | |||||
#include <functional> | #include <functional> | ||||
#include <memory> | #include <memory> | ||||
extern CCriticalSection cs_main; | |||||
class CBlock; | class CBlock; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
struct CBlockLocator; | struct CBlockLocator; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CConnman; | class CConnman; | ||||
class CReserveScript; | class CReserveScript; | ||||
class CValidationInterface; | class CValidationInterface; | ||||
class CValidationState; | class CValidationState; | ||||
Show All 24 Lines | |||||
* This is a synonym for the following, which asserts certain locks are not | * This is a synonym for the following, which asserts certain locks are not | ||||
* held: | * held: | ||||
* std::promise<void> promise; | * std::promise<void> promise; | ||||
* CallFunctionInValidationInterfaceQueue([&promise] { | * CallFunctionInValidationInterfaceQueue([&promise] { | ||||
* promise.set_value(); | * promise.set_value(); | ||||
* }); | * }); | ||||
* promise.get_future().wait(); | * promise.get_future().wait(); | ||||
*/ | */ | ||||
void SyncWithValidationInterfaceQueue(); | void SyncWithValidationInterfaceQueue() LOCKS_EXCLUDED(cs_main); | ||||
/** | /** | ||||
* Implement this to subscribe to events generated in validation | * Implement this to subscribe to events generated in validation | ||||
* | * | ||||
* Each CValidationInterface() subscriber will receive event callbacks | * Each CValidationInterface() subscriber will receive event callbacks | ||||
* in the order in which the events were generated by validation. | * in the order in which the events were generated by validation. | ||||
* Furthermore, each ValidationInterface() subscriber may assume that | * Furthermore, each ValidationInterface() subscriber may assume that | ||||
* callbacks effectively run in a single thread with single-threaded | * callbacks effectively run in a single thread with single-threaded | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |