diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index cef862fa..edfdeb3c 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -112,6 +112,7 @@ Peer.prototype.broadcast = function broadcast(items) { e: new EventEmitter(), timeout: setTimeout(function() { entry.e.emit('timeout'); + clearInterval(entry.interval); delete self._broadcast.map[key]; }, this._broadcast.timeout), diff --git a/lib/bcoin/script.js b/lib/bcoin/script.js index 81dac2b5..4c6ea27c 100644 --- a/lib/bcoin/script.js +++ b/lib/bcoin/script.js @@ -135,7 +135,7 @@ script.execute = function execute(s, stack, tx) { if (!res) return false; } else { - stack.push([ res ? 1 : 0 ]); + stack.push(res ? [ 1 ] : []); } } else if (o === 'checksigverify' || o === 'checksig') { @@ -144,7 +144,7 @@ script.execute = function execute(s, stack, tx) { var pub = stack.pop(); var sig = stack.pop(); - var type = sig.pop(); + var type = sig[sig.length - 1]; if (type !== 1) return false; @@ -153,7 +153,7 @@ script.execute = function execute(s, stack, tx) { if (!res) return false; } else { - stack.push([ res ? 1 : 0 ]); + stack.push(res ? [ 1 ] : []); } } else { // Unknown operation