mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
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.
This commit is contained in:
parent
3ae5b6af21
commit
25b6ae46e7
1 changed files with 1 additions and 0 deletions
|
@ -485,6 +485,7 @@ WitnessV1Taproot TaprootBuilder::GetOutput() { return WitnessV1Taproot{m_output_
|
|||
TaprootSpendData TaprootBuilder::GetSpendData() const
|
||||
{
|
||||
assert(IsComplete());
|
||||
assert(m_output_key.IsFullyValid());
|
||||
TaprootSpendData spd;
|
||||
spd.merkle_root = m_branch.size() == 0 ? uint256() : m_branch[0]->hash;
|
||||
spd.internal_key = m_internal_key;
|
||||
|
|
Loading…
Add table
Reference in a new issue