From 75218e784fce97858ec3cb8f0ad536728714e8db Mon Sep 17 00:00:00 2001 From: Wei Lu Date: Tue, 25 Mar 2014 12:28:26 +0800 Subject: [PATCH] Transaction fee calculation does not need BigInteger --- src/transaction.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/transaction.js b/src/transaction.js index 6059fc5..8686a48 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -383,11 +383,9 @@ Transaction.prototype.estimateFee = function(feePerKb){ var outSize = 34 var fixedPadding = 34 var feePerKb = feePerKb || Transaction.feePerKb - var size = this.ins.length * uncompressedInSize + this.outs.length * outSize + fixedPadding - var sizeInKb = BigInteger.valueOf(Math.ceil(size / 1000)) - return BigInteger.valueOf(feePerKb).multiply(sizeInKb).intValue() + return feePerKb * Math.ceil(size / 1000) } var TransactionIn = function (data) {