consensus change for segwit.
See https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-June/012747.html
This commit is contained in:
parent
1984bc178c
commit
9ff5ee82e7
@ -2599,7 +2599,7 @@ Script.prototype.getCommitmentHash = function getCommitmentHash() {
|
|||||||
Script.prototype.isWitnessProgram = function isWitnessProgram() {
|
Script.prototype.isWitnessProgram = function isWitnessProgram() {
|
||||||
// Witness programs are strict minimaldata.
|
// Witness programs are strict minimaldata.
|
||||||
if (this.raw) {
|
if (this.raw) {
|
||||||
if (!(this.raw.length >= 4 && this.raw.length <= 34))
|
if (!(this.raw.length >= 4 && this.raw.length <= 42))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (this.raw[0] !== opcodes.OP_0
|
if (this.raw[0] !== opcodes.OP_0
|
||||||
@ -2624,7 +2624,7 @@ Script.prototype.isWitnessProgram = function isWitnessProgram() {
|
|||||||
|
|
||||||
return (this.code[0] === opcodes.OP_0
|
return (this.code[0] === opcodes.OP_0
|
||||||
|| (this.code[0] >= opcodes.OP_1 && this.code[0] <= opcodes.OP_16))
|
|| (this.code[0] >= opcodes.OP_1 && this.code[0] <= opcodes.OP_16))
|
||||||
&& this.code[1].length >= 2 && this.code[1].length <= 32;
|
&& this.code[1].length >= 2 && this.code[1].length <= 40;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user