| 16 | |
| 17 | namespace kernel { |
| 18 | interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* index, const CBlock* data) |
| 19 | { |
| 20 | interfaces::BlockInfo info{index ? *index->phashBlock : uint256::ZERO}; |
| 21 | if (index) { |
| 22 | info.prev_hash = index->pprev ? index->pprev->phashBlock : nullptr; |
| 23 | info.height = index->nHeight; |
| 24 | info.chain_time_max = index->GetBlockTimeMax(); |
| 25 | LOCK(::cs_main); |
| 26 | info.file_number = index->nFile; |
| 27 | info.data_pos = index->nDataPos; |
| 28 | } |
| 29 | info.data = data; |
| 30 | return info; |
| 31 | } |
| 32 | |
| 33 | std::ostream& operator<<(std::ostream& os, const ChainstateRole& role) { |
| 34 | if (!role.validated) { |
no test coverage detected