#ifndef BITCOIN_KERNEL_CHAIN_H
#define BITCOIN_KERNEL_CHAIN_H
#include <attributes.h>
#include <iostream>
class CBlock;
class CBlockIndex;
class CBlockUndo;
class uint256;
namespace interfaces {
struct BlockInfo {
const uint256& hash;
const uint256* prev_hash = nullptr;
int height = -1;
int file_number = -1;
unsigned data_pos = 0;
const CBlock* data = nullptr;
const CBlockUndo* undo_data = nullptr;
unsigned int chain_time_max{0};
BlockInfo(const uint256& hash LIFETIMEBOUND) : hash(hash) {}
};
}
namespace kernel {
struct ChainstateRole;
interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* block_index, const CBlock* data = nullptr);
std::ostream& operator<<(std::ostream& os, const ChainstateRole& role);
}
#endif