HomePhabricator

psbt: Assert that tx has a value in UpdatePSBTOutput

Description

psbt: Assert that tx has a value in UpdatePSBTOutput

Summary:
This was previously done implicitly in boost::optional by BOOST_ASSERT.
Also, it was checked at runtime by valgrind if for some reason the
assert was disabled.

std::optional dereference won't assert, so add the Assert here
explicitly.

The explicit Assert also helps to document the code better.

This is a partial backport of core#20671 and a follow-up to D8494

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Aug 21 2023, 11:20
PiRKPushed on Aug 21 2023, 15:16
Reviewer
Restricted Project
Differential Revision
D14390: psbt: Assert that tx has a value in UpdatePSBTOutput
Parents
rABCa7ab5a98eb95: Update TSan suppressions
Branches
Unknown
Tags
Unknown