Commit 629a919
committed
CScript.is_witness_scriptpubkey : size must match second byte + 2
Model CScript.is_witness_scriptpubkey after bitcoind's
CScript::IsWitnessProgram -- it not only checks for script size
and first opcode, but also checks that data push size equals
script size + 2 (entire script consists of version byte
and data push). In absense of this check, is_witness_scriptpubkey
wrongfully detects 1-of-1 p2sh redeem script as a witness program.1 parent 05cbb3c commit 629a919
1 file changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
682 | | - | |
683 | | - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
684 | 698 | | |
685 | 699 | | |
686 | 700 | | |
| |||
0 commit comments