aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-06-24 12:43:06 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-06-27 16:47:48 -0400
commit25b6ae46e7249a1b363ef4fb12375f368903c58e (patch)
tree839cd29d38d4f1d229fa494c361b70396b60cd58 /src
parent3ae5b6af21cf45b3da5e341e84f50e0717eaf589 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/script/standard.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/script/standard.cpp b/src/script/standard.cpp
index 063e149d36..5d80891485 100644
--- a/src/script/standard.cpp
+++ b/src/script/standard.cpp
@@ -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;