Skip to content

Conversation

@sipa
Copy link
Owner

@sipa sipa commented Feb 18, 2022

No description provided.

Copy link
Contributor

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 5f89d90


using Node = miniscript::NodeRef<CompilerContext::Key>;
using NodeType = miniscript::NodeType;
using Fragment = miniscript::Fragment;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arg. Had this patch for #99 but forgot to commit it...

Comment on lines +978 to +983
const Node* FindInsaneSub() const {
return TreeEval<const Node*>([](const Node& node, Span<const Node*> subs) -> const Node* {
for (auto& sub: subs) if (sub) return sub;
if (!node.IsSane()) return &node;
return nullptr;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed much nicer. I successfully tested against the Bitcoin Core PR which had test vectors for it.

@sipa sipa merged commit 9a13a0d into master Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants