diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-06-15 23:09:37 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-06-28 09:52:32 +0200 |
commit | 7320db96f8d2aeff0bc5dc67d8b7b37f5f808990 (patch) | |
tree | 6a15f7fac466f6c0d4dc75ff05a9b52205c1102f /src/bitcoin-chainstate.cpp | |
parent | 3fa9094b92c5d37f486b0f8265062d3456796a50 (diff) |
kernel: Add flushError method to notifications
This is done in addition with the following commit. Both have the goal
of getting rid of direct calls to AbortNode from kernel code. This extra
flushError method is added to notify specifically about errors that
arrise when flushing (syncing) block data to disk. Unlike other
instances, the current calls to AbortNode in the blockstorage flush
functions do not report an error to their callers.
This commit is part of the libbitcoinkernel project and further removes
the shutdown's and, more generally, the kernel library's dependency on
interface_ui with a kernel notification method. By removing interface_ui
from the kernel library, its dependency on boost is reduced to just
boost::multi_index. At the same time it also takes a step towards
de-globalising the interrupt infrastructure.
Diffstat (limited to 'src/bitcoin-chainstate.cpp')
-rw-r--r-- | src/bitcoin-chainstate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index da42372a6a..cb391e30de 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -97,6 +97,11 @@ int main(int argc, char* argv[]) { std::cout << "Warning: " << warning.original << std::endl; } + void flushError(const std::string& debug_message) override + { + std::cerr << "Error flushing block data to disk: " << debug_message << std::endl; + } + }; auto notifications = std::make_unique<KernelNotifications>(); @@ -112,6 +117,7 @@ int main(int argc, char* argv[]) const node::BlockManager::Options blockman_opts{ .chainparams = chainman_opts.chainparams, .blocks_dir = abs_datadir / "blocks", + .notifications = chainman_opts.notifications, }; ChainstateManager chainman{kernel_context.interrupt, chainman_opts, blockman_opts}; |