script: fix potential uncaught error.

This commit is contained in:
Christopher Jeffrey 2016-12-11 10:08:46 -08:00
parent dcef9beed5
commit efa0d3eac5
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -2976,6 +2976,9 @@ Script.prototype.getScripthashSigops = function getScripthashSigops(input) {
if (!this.isScripthash())
return this.getSigops(true);
if (input.code.length === 0)
return 0;
for (i = 0; i < input.code.length; i++) {
op = input.code[i];