diff options
Diffstat (limited to 'src/kernel/chain.cpp')
-rw-r--r-- | src/kernel/chain.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kernel/chain.cpp b/src/kernel/chain.cpp index 1c877866d0..318c956b38 100644 --- a/src/kernel/chain.cpp +++ b/src/kernel/chain.cpp @@ -4,6 +4,7 @@ #include <chain.h> #include <interfaces/chain.h> +#include <kernel/chain.h> #include <sync.h> #include <uint256.h> @@ -25,3 +26,13 @@ interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* index, const CBlock* data return info; } } // namespace kernel + +std::ostream& operator<<(std::ostream& os, const ChainstateRole& role) { + switch(role) { + case ChainstateRole::NORMAL: os << "normal"; break; + case ChainstateRole::ASSUMEDVALID: os << "assumedvalid"; break; + case ChainstateRole::BACKGROUND: os << "background"; break; + default: os.setstate(std::ios_base::failbit); + } + return os; +} |