diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-05-17 12:43:23 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-06-28 09:52:27 +0200 |
commit | edb55e2777063dfeba0a52bbd0b92af8b4688501 (patch) | |
tree | 82db5d343132d77b8fdd5c99dcd4fcd92fca9e7c /src/validation.h | |
parent | e2d680a32d757de0ef8eb836047a0daa1d82e3c4 (diff) |
kernel: Pass interrupt reference to chainman
This and the following commit seek to decouple the libbitcoinkernel
library from the shutdown code. As a library, it should it should have
its own flexible interrupt infrastructure without relying on node-wide
globals.
The commit takes the first step towards this goal by de-globalising
`ShutdownRequested` calls in kernel code.
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: TheCharlatan <seb.kung@gmail.com>
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/validation.h b/src/validation.h index 8bc8842c54..5412cb1d48 100644 --- a/src/validation.h +++ b/src/validation.h @@ -62,6 +62,9 @@ class SnapshotMetadata; namespace Consensus { struct Params; } // namespace Consensus +namespace util { +class SignalInterrupt; +} // namespace util /** Maximum number of dedicated script-checking threads allowed */ static const int MAX_SCRIPTCHECK_THREADS = 15; @@ -959,7 +962,7 @@ private: public: using Options = kernel::ChainstateManagerOpts; - explicit ChainstateManager(Options options, node::BlockManager::Options blockman_options); + explicit ChainstateManager(const util::SignalInterrupt& interrupt, Options options, node::BlockManager::Options blockman_options); const CChainParams& GetParams() const { return m_options.chainparams; } const Consensus::Params& GetConsensus() const { return m_options.chainparams.GetConsensus(); } @@ -982,6 +985,7 @@ public: */ RecursiveMutex& GetMutex() const LOCK_RETURNED(::cs_main) { return ::cs_main; } + const util::SignalInterrupt& m_interrupt; const Options m_options; std::thread m_load_block; //! A single BlockManager instance is shared across each constructed |