rust-bitcoin / rust-miniscript

Support for Miniscript and Output Descriptors for rust-bitcoin
Creative Commons Zero v1.0 Universal
343 stars 135 forks source link

Compiling invalid policy "thresh(2,pk(),thresh(0,pk()))" causes "threshold subs, which we just compiled, typeck: TypeCheck("fragment «thresh(0,jtvc:pk_h())» has a threshold value of 0")" #48

Closed practicalswift closed 4 years ago

practicalswift commented 5 years ago

Compiling invalid policy thresh(2,pk(),thresh(0,pk())) causes threshold subs, which we just compiled, typeck: TypeCheck("fragment «thresh(0,jtvc:pk_h())» has a threshold value of 0").

Crash location:

https://github.com/apoelstra/rust-miniscript/blob/2aee5708e3e4f29a4d41301adc998d6b95fc4c76/src/policy/compiler.rs#L960-L964

sanket1729 commented 4 years ago

Fixed by #50 .