make witness scripts abide by max_element_size again.

This commit is contained in:
Christopher Jeffrey 2016-05-05 06:24:09 -07:00
parent f5b4bb2bf6
commit 98774d0c0b
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -162,13 +162,8 @@ Address.prototype.getScript = function getScript() {
redeem = bcoin.script.createMultisig(this.keys, this.m, this.n);
if (this.witness) {
if (redeem.getSize() > 10000)
throw new Error('Redeem script too large (10000 byte limit).');
} else {
if (redeem.getSize() > 520)
throw new Error('Redeem script too large (520 byte limit).');
}
if (redeem.getSize() > 520)
throw new Error('Redeem script too large (520 byte limit).');
this._script = redeem;
}
@ -195,9 +190,6 @@ Address.prototype.getProgram = function getProgram() {
hash = Address.sha256(this.getScript().encode());
program = bcoin.script.createWitnessProgram(0, hash);
}
assert(program);
this._program = program;
}