Bitcoin Core
32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
node
block_validation_state_catcher.h
Go to the documentation of this file.
1
// Copyright (c) 2021-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_NODE_BLOCK_VALIDATION_STATE_CATCHER_H
6
#define BITCOIN_NODE_BLOCK_VALIDATION_STATE_CATCHER_H
7
8
#include <
consensus/validation.h
>
9
#include <
validationinterface.h
>
10
11
#include <memory>
12
#include <optional>
13
14
namespace
node
{
15
19
class
BlockValidationStateCatcher
final :
public
CValidationInterface
20
{
21
private
:
22
uint256
m_hash
;
23
24
public
:
25
std::optional<BlockValidationState>
m_state
;
26
explicit
BlockValidationStateCatcher
(
const
uint256
& hash) :
m_hash
(hash) {};
27
28
protected
:
29
void
BlockChecked
(
const
std::shared_ptr<const CBlock>& block,
const
BlockValidationState
& state)
override
30
{
31
if
(block->GetHash() ==
m_hash
)
m_state
= state;
32
}
33
};
34
35
}
// namespace node
36
37
#endif
// BITCOIN_NODE_BLOCK_VALIDATION_STATE_CATCHER_H
BlockValidationState
Definition
validation.h:133
CValidationInterface
Implement this to subscribe to events generated in validation and mempool.
Definition
validationinterface.h:50
node::BlockValidationStateCatcher
Captures the validation state reported for a specific block.
Definition
block_validation_state_catcher.h:20
node::BlockValidationStateCatcher::m_hash
uint256 m_hash
Definition
block_validation_state_catcher.h:22
node::BlockValidationStateCatcher::BlockChecked
void BlockChecked(const std::shared_ptr< const CBlock > &block, const BlockValidationState &state) override
Notifies listeners of a block validation result.
Definition
block_validation_state_catcher.h:29
node::BlockValidationStateCatcher::m_state
std::optional< BlockValidationState > m_state
Definition
block_validation_state_catcher.h:25
node::BlockValidationStateCatcher::BlockValidationStateCatcher
BlockValidationStateCatcher(const uint256 &hash)
Definition
block_validation_state_catcher.h:26
uint256
256-bit opaque blob.
Definition
uint256.h:196
validation.h
node
Definition
messages.h:21
validationinterface.h
Generated on Thu Nov 5 2026 20:00:44 for Bitcoin Core by
1.9.8