HomePhabricator

[test] Throw error instead of segfaulting in failure scenario

Description

[test] Throw error instead of segfaulting in failure scenario

Summary:
If the miner code is faulty and does not include any transactions in a block,
the code segfaults when it tries to access block transactions. Instead, add a
check that safely aborts the process.

This is a backport of core#21121 [2/4]
https://github.com/bitcoin/bitcoin/pull/21121/commits/a2d908e1daa1d1be74568bd7d1d04b724da7d79c

Test Plan: ninja check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Amiti Uttarwar <amiti@uttarwar.org>Authored on Feb 2 2021, 23:07
PiRKCommitted on Oct 4 2022, 14:18
PiRKPushed on Oct 4 2022, 14:19
Reviewer
Restricted Project
Differential Revision
D12107: [test] Throw error instead of segfaulting in failure scenario
Parents
rABCce562c7e8f36: test: Remove spurious double lock tsan suppressions by bumping to clang-12
Branches
Unknown
Tags
Unknown