Bitcoin Core  24.99.0
P2P Digital Currency
validation.cpp
Go to the documentation of this file.
1 // Copyright (c) 2020 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 #include <test/util/validation.h>
6 
7 #include <util/check.h>
8 #include <util/time.h>
9 #include <validation.h>
10 #include <validationinterface.h>
11 
13 {
14  m_cached_finished_ibd = false;
15  assert(IsInitialBlockDownload());
16 }
17 
19 {
20  Assert(IsInitialBlockDownload());
21  m_cached_finished_ibd = true;
22  Assert(!IsInitialBlockDownload());
23 }
24 
25 void ValidationInterfaceTest::BlockConnected(CValidationInterface& obj, const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex)
26 {
27  obj.BlockConnected(block, pindex);
28 }
#define Assert(val)
Identity function.
Definition: check.h:74
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:152
Implement this to subscribe to events generated in validation.
virtual void BlockConnected(const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex)
Notifies listeners of a block being connected.
std::atomic< bool > m_cached_finished_ibd
Whether this chainstate is undergoing initial block download.
Definition: validation.h:464
static void BlockConnected(CValidationInterface &obj, const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex)
Definition: validation.cpp:25
void ResetIbd()
Reset the ibd cache to its initial state.
Definition: validation.cpp:12
void JumpOutOfIbd()
Toggle IsInitialBlockDownload from true to false.
Definition: validation.cpp:18
assert(!tx.IsCoinBase())