Skip to content

Commit 25b6ae4

Browse files
committed
Assert that TaprootBuilder is Finalized during GetSpendData
GetSpendData needs to be finalized in order to be used. To avoid future bugs, assert `!m_output_key.IsNull()` as m_output_key is only set during Finalize.
1 parent 3ae5b6a commit 25b6ae4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/script/standard.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ WitnessV1Taproot TaprootBuilder::GetOutput() { return WitnessV1Taproot{m_output_
485485
TaprootSpendData TaprootBuilder::GetSpendData() const
486486
{
487487
assert(IsComplete());
488+
assert(m_output_key.IsFullyValid());
488489
TaprootSpendData spd;
489490
spd.merkle_root = m_branch.size() == 0 ? uint256() : m_branch[0]->hash;
490491
spd.internal_key = m_internal_key;

0 commit comments

Comments
 (0)