aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/chain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/chain.h')
-rw-r--r--src/kernel/chain.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/kernel/chain.h b/src/kernel/chain.h
index f0750f8266..feba24a557 100644
--- a/src/kernel/chain.h
+++ b/src/kernel/chain.h
@@ -5,6 +5,8 @@
#ifndef BITCOIN_KERNEL_CHAIN_H
#define BITCOIN_KERNEL_CHAIN_H
+#include<iostream>
+
class CBlock;
class CBlockIndex;
namespace interfaces {
@@ -14,6 +16,24 @@ struct BlockInfo;
namespace kernel {
//! Return data from block index.
interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* block_index, const CBlock* data = nullptr);
+
} // namespace kernel
+//! This enum describes the various roles a specific Chainstate instance can take.
+//! Other parts of the system sometimes need to vary in behavior depending on the
+//! existence of a background validation chainstate, e.g. when building indexes.
+enum class ChainstateRole {
+ // Single chainstate in use, "normal" IBD mode.
+ NORMAL,
+
+ // Doing IBD-style validation in the background. Implies use of an assumed-valid
+ // chainstate.
+ BACKGROUND,
+
+ // Active assumed-valid chainstate. Implies use of a background IBD chainstate.
+ ASSUMEDVALID,
+};
+
+std::ostream& operator<<(std::ostream& os, const ChainstateRole& role);
+
#endif // BITCOIN_KERNEL_CHAIN_H