Block_log_util- problem with small testnet block_logs
I recognized something interesting in block_log_util tool. On small block_logs this util have problems with correct recognition of head block. These problems have been observed with get-block and get-head-block-number subcommands.
- For block_logs with number of blocks 0:21 block_log util have head_block with number 0
- For block_logs with number of blocks 22 this tool throw exception:
Error: 10 assert_exception: Assert Exception\n(size_t)(block_log_size) > (head_block_offset - sizeof(head_block_offset))\nblock log file is corrupted, head block offset is greater than file size; block_log_size=120, head_block_offset=0\
- For block_logs with number of blocks 23:29 block_log util have head_block number 21 blocks less than correct, e.g: for 23 blocks block_log - head 2, for 24- head 3.
- For block_logs bigger than 29 blocks everything is okay.
I'm wondering is this tool work correctly.
Edited by Radosław Masłowski