further simplify use of bignum in Transaction and ScriptInterpreter

This commit is contained in:
Ryan X. Charles 2014-07-10 19:26:03 -07:00
parent 823d02118c
commit c75de967fd
2 changed files with 3 additions and 3 deletions

View File

@ -494,14 +494,14 @@ ScriptInterpreter.prototype.eval = function eval(script, tx, inIndex, hashType,
break;
case Opcode.map.OP_LSHIFT:
if (v2.cmp(0) < 0 || v2.cmp(bignum(2048)) > 0) {
if (v2.cmp(0) < 0 || v2.cmp(2048) > 0) {
throw new Error("OP_LSHIFT parameter out of bounds");
}
num = v1.shiftLeft(v2);
break;
case Opcode.map.OP_RSHIFT:
if (v2.cmp(0) < 0 || v2.cmp(bignum(2048)) > 0) {
if (v2.cmp(0) < 0 || v2.cmp(2048) > 0) {
throw new Error("OP_RSHIFT parameter out of bounds");
}
num = v1.shiftRight(v2);

View File

@ -512,7 +512,7 @@ Transaction.prototype.fromObj = function fromObj(obj) {
var addr = new Address(addrStr);
var script = Script.createPubKeyHashOut(addr.payload());
var valueNum = new bignum(obj.outputs[addrStr]);
var valueNum = bignum(obj.outputs[addrStr]);
var value = util.bigIntToValue(valueNum);
var txout = new TransactionOut();