HomePhabricator

Fix UB with bench on genesis block

Description

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:"

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8857

Details

Provenance
Gregory Sanders <gsanders87@gmail.com>Authored on Jan 9 2021, 13:55
PiRKCommitted on Jan 9 2021, 13:56
abc-botPushed on Jan 9 2021, 14:02
Reviewer
Restricted Project
Differential Revision
D8857: Fix UB with bench on genesis block
Parents
rABCa5d817fae887: [tests] remove bignum.py
Branches
Unknown
Tags
Unknown