HomePhabricator

Add ChainstateManagerOpts, using as ::Options, pass it an adjusted_time_callback

Description

Add ChainstateManagerOpts, using as ::Options, pass it an adjusted_time_callback

Summary:
This reduces coupling validation.cpp from netaddress.cpp (transitively,
timedata.cpp, and asmap.cpp). We unfortunately still have the transitive coupling with these modules because of validation -> avalanche/processor -> net.

This is important for libbitcoinkernel as:

  • There is no reason for the consensus engine to be coupled with netaddress, timedata, and asmap
  • Users of libbitcoinkernel can now easily supply their own std::function that provides the adjusted time.

This is a backport of core#25064

Test Plan: cmake .. -GNinja -DBUILD_BITCOIN_CHAINSTATE=ON && ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15031

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Mar 1 2022, 21:14
PiRKCommitted on Dec 22 2023, 09:39
PiRKPushed on Dec 22 2023, 09:39
Reviewer
Restricted Project
Differential Revision
D15031: Add ChainstateManagerOpts, using as ::Options, pass it an adjusted_time_callback
Parents
rABCf72321734870: [Cashtab] Add new helper function to generate to-spec targetOutputs for alias…
Branches
Unknown
Tags
Unknown