Skip to content

Commit d5618c1

Browse files
committed
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`
1 parent 90f99fe commit d5618c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/TransactionBuilder.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function TransactionBuilder(opts) {
109109
this.lockTime = opts.lockTime || 0;
110110
this.spendUnconfirmed = opts.spendUnconfirmed || false;
111111

112-
this.givenFeeSat = typeof(opts.fee) !== 'undefined' ? opts.fee * util.COIN : opts.feeSat;
112+
this.givenFeeSat = typeof opts.fee !== 'undefined' ? opts.fee * util.COIN : opts.feeSat;
113113

114114
this.remainderOut = opts.remainderOut;
115115
this.signhash = opts.signhash || Transaction.SIGHASH_ALL;
@@ -357,7 +357,7 @@ TransactionBuilder.prototype._setFeeAndRemainder = function(txobj) {
357357
/* based on https://en.bitcoin.it/wiki/Transaction_fees */
358358
maxSizeK = parseInt(size / 1000) + 1;
359359

360-
var feeSat = typeof(this.givenFeeSat) !== 'undefined' ? this.givenFeeSat : maxSizeK * FEE_PER_1000B_SAT;
360+
var feeSat = typeof this.givenFeeSat !== 'undefined' ? this.givenFeeSat : maxSizeK * FEE_PER_1000B_SAT;
361361

362362
var neededAmountSat = this.valueOutSat.add(feeSat);
363363

0 commit comments

Comments
 (0)