script: max length. chain: deadbeef fix.

This commit is contained in:
Christopher Jeffrey 2015-11-30 12:36:06 -08:00
parent 1fc432012d
commit a6584ae821
2 changed files with 5 additions and 1 deletions

View File

@ -447,7 +447,7 @@ Chain.prototype.fromJSON = function fromJSON(json) {
if (this.index.bloom)
this.index.bloom.reset();
else
this.index.bloom = new bcoin.bloom(28 * 1024 * 1024, 16, 0xdeadbee0);
this.index.bloom = new bcoin.bloom(28 * 1024 * 1024, 16, 0xdeadbeef);
if (this.index.hashes.length === 0)
this.add(new bcoin.block(constants.genesis, 'block'));

View File

@ -110,6 +110,10 @@ script.subscript = function subscript(s) {
};
script.execute = function execute(s, stack, tx) {
if (s.length > 10000) {
return false;
}
for (var pc = 0; pc < s.length; pc++) {
var o = s[pc];
if (Array.isArray(o)) {