Add error for when pushdata is exceptionally large
This commit is contained in:
parent
b37e39abca
commit
729049a7da
@ -267,6 +267,8 @@ Script.prototype.writeBuffer = function(buf) {
|
|||||||
opcodenum = Opcode.map.OP_PUSHDATA2;
|
opcodenum = Opcode.map.OP_PUSHDATA2;
|
||||||
} else if (buf.length < Math.pow(2, 32)) {
|
} else if (buf.length < Math.pow(2, 32)) {
|
||||||
opcodenum = Opcode.map.OP_PUSHDATA4;
|
opcodenum = Opcode.map.OP_PUSHDATA4;
|
||||||
|
} else {
|
||||||
|
throw new Error("You can't push that much data");
|
||||||
}
|
}
|
||||||
this.chunks.push({
|
this.chunks.push({
|
||||||
buf: buf,
|
buf: buf,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user