Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.

Fix panic in compile_tr_private_experimental for non-expandable policies - #917

Merged
apoelstra merged 1 commit into
rust-bitcoin:masterfrom
febyeji:fix-compile-tr-private-panic
Apr 9, 2026
Merged

apoelstra merged 1 commit into
rust-bitcoin:masterfrom
febyeji:fix-compile-tr-private-panic

Conversation

@febyeji

@febyeji febyeji commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #902.

  • Keep pol_prob_map in sync with tapleaf_prob_vec by removing entries from both data structures together.
  • Previously, removing a node from tapleaf_prob_vec without removing it from pol_prob_map caused a panic when expand_fn returned the same policy (e.g. for pk(A) or and(pk(A),pk(B))).
  • Adds regression tests for both cases.

Comment thread src/policy/concrete.rs Resolved
…andable policies

Keep pol_prob_map in sync with tapleaf_prob_vec by removing entries
from both data structures together. Previously, removing a node from
tapleaf_prob_vec without removing it from pol_prob_map caused a panic
when expand_fn returned the same policy (e.g. for pk(A) or
and(pk(A),pk(B))).

Fixes rust-bitcoin#902

@apoelstra apoelstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK f728d78; successfully ran local tests

@apoelstra apoelstra changed the title Fix panic in compile_tr_private_experimental for non-expandable policies Fix panic in compile_tr_private_experimental for non-expandable policies Apr 9, 2026
@apoelstra
apoelstra merged commit 4109aaf into rust-bitcoin:master Apr 9, 2026
26 checks passed
@febyeji
febyeji deleted the fix-compile-tr-private-panic branch April 27, 2026 06:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile_tr and compile_tr_private_experimental fail for pk(A)

3 participants