HomePhabricator

Fix a data race that could prevent the staking reward to be added to the block…

Description

Fix a data race that could prevent the staking reward to be added to the block template when longpoll is used

Summary:
This diff turns the best block global into a block index instead of a hash and performs a staking reward computation
upon longpoll interruption when building the block template. It avoids a data race where the template could be
constructed and returned before the computation of staking rewards is complete, leading to an empty winner and
potentially a rejected block.

Test Plan:

for i in {1..1000}; do echo "Trial $i/1000" && ./test/functional/test_runner.py abc_mining_stakingrewards || break; done

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Jul 7 2024, 14:19
FabienPushed on Jul 8 2024, 06:46
Reviewer
Restricted Project
Differential Revision
D16430: Fix a data race that could prevent the staking reward to be added to the block template when longpoll is used
Parents
rABCce6ed33b3e6c: [Automated] Update chainparams
Branches
Unknown
Tags
Unknown