Fixed bug in IE11 that would cause MAX_MONEY verification test to fail.
This commit is contained in:
parent
ff4a6f549d
commit
bce28cd227
|
@ -83,7 +83,6 @@ Output.prototype.setScript = function(script) {
|
|||
this._scriptBuffer = script;
|
||||
this._script = null;
|
||||
} else {
|
||||
console.log(script);
|
||||
throw new TypeError('Unrecognized Argument');
|
||||
}
|
||||
return this;
|
||||
|
|
|
@ -656,11 +656,11 @@ Transaction.prototype.verify = function() {
|
|||
var valueoutbn = BN(0);
|
||||
for (var i = 0; i < this.outputs.length; i++) {
|
||||
var txout = this.outputs[i];
|
||||
var valuebn = BN(txout.satoshis.toString(16));
|
||||
var valuebn = txout._satoshis;
|
||||
if (valuebn.lt(0)) {
|
||||
return 'transaction txout ' + i + ' negative';
|
||||
}
|
||||
if (valuebn.gt(Transaction.MAX_MONEY)) {
|
||||
if (valuebn.gt(BN(Transaction.MAX_MONEY, 10))) {
|
||||
return 'transaction txout ' + i + ' greater than MAX_MONEY';
|
||||
}
|
||||
valueoutbn = valueoutbn.add(valuebn);
|
||||
|
|
|
@ -259,7 +259,8 @@ describe('Interpreter', function() {
|
|||
return;
|
||||
}
|
||||
c++;
|
||||
it('should pass tx_' + (expected ? '' : 'in') + 'valid vector ' + c, function() {
|
||||
var cc = c; //copy to local
|
||||
it('should pass tx_' + (expected ? '' : 'in') + 'valid vector ' + cc, function() {
|
||||
var inputs = vector[0];
|
||||
var txhex = vector[1];
|
||||
var flags = getFlags(vector[2]);
|
||||
|
@ -291,9 +292,10 @@ describe('Interpreter', function() {
|
|||
}
|
||||
});
|
||||
var txVerified = tx.verify();
|
||||
txVerified = _.isBoolean(txVerified);
|
||||
txVerified = (txVerified === true) ? true : false;
|
||||
allInputsVerified = allInputsVerified && txVerified;
|
||||
allInputsVerified.should.equal(expected);
|
||||
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue