Move ::hashAssumeValid into ChainstateManager

This changes the assumed valid block for the bitcoin-chainstate
executable. Previously it was uint256{}, now it is defaultAssumeValid.
This commit is contained in:
MacroFake 2022-07-20 22:00:11 +02:00
parent faf44876db
commit fa29d0b57c
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
6 changed files with 26 additions and 14 deletions

View file

@ -5,10 +5,12 @@
#ifndef BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H
#define BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H
#include <uint256.h>
#include <util/time.h>
#include <cstdint>
#include <functional>
#include <optional>
class CChainParams;
@ -24,6 +26,8 @@ namespace kernel {
struct ChainstateManagerOpts {
const CChainParams& chainparams;
const std::function<NodeClock::time_point()> adjusted_time_callback{nullptr};
//! If set, it will override the block hash whose ancestors we will assume to have valid scripts without checking them.
std::optional<uint256> assumed_valid_block;
//! If the tip is older than this, the node is considered to be in initial block download.
std::chrono::seconds max_tip_age{DEFAULT_MAX_TIP_AGE};
};