Page MenuHomePhabricator

Fix UB with bench on genesis block
ClosedPublic

Authored by PiRK on Fri, Jan 8, 22:40.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCad59559de161: Fix UB with bench on genesis block
Summary

During the loading of the genesis block, the bench print lines in ConnectTip divide by zero due to early return in ConnectBlock.

Increment nBlocksTotal before returning in ConnectBlock

This is a backport of Core PR15283

Test Plan

ninja && ./src/bitcoind -debug=bench | grep "Connect total:"

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.