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/node/blockstorage.h | |
parent | e2d680a32d757de0ef8eb836047a0daa1d82e3c4 (diff) | |
download | bitcoin-edb55e2777063dfeba0a52bbd0b92af8b4688501.tar.xz |
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/node/blockstorage.h')
-rw-r--r-- | src/node/blockstorage.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index a1ebb0df0a..36b8aa4806 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -33,6 +33,9 @@ struct FlatFilePos; namespace Consensus { struct Params; } +namespace util { +class SignalInterrupt; +} // namespace util namespace node { @@ -153,10 +156,12 @@ private: public: using Options = kernel::BlockManagerOpts; - explicit BlockManager(Options opts) + explicit BlockManager(const util::SignalInterrupt& interrupt, Options opts) : m_prune_mode{opts.prune_target > 0}, - m_opts{std::move(opts)} {}; + m_opts{std::move(opts)}, + m_interrupt{interrupt} {}; + const util::SignalInterrupt& m_interrupt; std::atomic<bool> m_importing{false}; BlockMap m_block_index GUARDED_BY(cs_main); |