From d5618c186f74c1a4a2986a46fc330f1331f27134 Mon Sep 17 00:00:00 2001 From: Sagiv Ofek Date: Sat, 6 Sep 2014 00:47:44 -0400 Subject: [PATCH] syntax fix - typeof is not a function, it's an operator following the comment of @shesek here: https://github.com/bitpay/bitcore/pull/500/files#r16642032 `typeof(foo)` should be `typeof foo` --- lib/TransactionBuilder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/TransactionBuilder.js b/lib/TransactionBuilder.js index 024ad29ee..d4b60d650 100644 --- a/lib/TransactionBuilder.js +++ b/lib/TransactionBuilder.js @@ -109,7 +109,7 @@ function TransactionBuilder(opts) { this.lockTime = opts.lockTime || 0; this.spendUnconfirmed = opts.spendUnconfirmed || false; - this.givenFeeSat = typeof(opts.fee) !== 'undefined' ? opts.fee * util.COIN : opts.feeSat; + this.givenFeeSat = typeof opts.fee !== 'undefined' ? opts.fee * util.COIN : opts.feeSat; this.remainderOut = opts.remainderOut; this.signhash = opts.signhash || Transaction.SIGHASH_ALL; @@ -357,7 +357,7 @@ TransactionBuilder.prototype._setFeeAndRemainder = function(txobj) { /* based on https://en.bitcoin.it/wiki/Transaction_fees */ maxSizeK = parseInt(size / 1000) + 1; - var feeSat = typeof(this.givenFeeSat) !== 'undefined' ? this.givenFeeSat : maxSizeK * FEE_PER_1000B_SAT; + var feeSat = typeof this.givenFeeSat !== 'undefined' ? this.givenFeeSat : maxSizeK * FEE_PER_1000B_SAT; var neededAmountSat = this.valueOutSat.add(feeSat);