| 694 | } |
| 695 | |
| 696 | static CBlock GetBlockChecked(BlockManager& blockman, const CBlockIndex& blockindex) |
| 697 | { |
| 698 | CBlock block; |
| 699 | { |
| 700 | LOCK(cs_main); |
| 701 | CheckBlockDataAvailability(blockman, blockindex, /*check_for_undo=*/false); |
| 702 | } |
| 703 | |
| 704 | if (!blockman.ReadBlock(block, blockindex)) { |
| 705 | // Block not found on disk. This shouldn't normally happen unless the block was |
| 706 | // pruned right after we released the lock above. |
| 707 | throw JSONRPCError(RPC_MISC_ERROR, "Block not found on disk"); |
| 708 | } |
| 709 | |
| 710 | return block; |
| 711 | } |
| 712 | |
| 713 | static std::vector<std::byte> GetRawBlockChecked(BlockManager& blockman, const CBlockIndex& blockindex) |
| 714 | { |
no test coverage detected