Page MenuHomePhabricator

[Chronik] Fix: Indexed block size is 0 when running `-chronikindex`
ClosedPublic

Authored by tobias_ruck on Jun 4 2023, 19:10.

Details

Summary

During -chronikreindex, CBlockIndex::nSize seems to be 0, and the wrong value is indexed for the block size.

This should potentially be fixed downstream (by setting nSize correctly before running the -chronikreindex loop), but for now, using ::GetSerializeSize fixes the bug.

Test Plan
  1. ninja && ./test/functional/test_runner.py chronik_block
  2. Use nSize in chronik_bridge.cpp instead of GetSerializeSize, now chronik_block.py should fail.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable