bitcore-lib
bitcore-lib copied to clipboard
Question about feePerKb
I see that if transaction size is smaller than 1 kb then total fee is equal to feePerKb value.
Transaction._estimateFee = function(size, amountAvailable, feePerKb) {
var fee = Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB);
if (amountAvailable > fee) {
size += Transaction.CHANGE_OUTPUT_MAX_SIZE;
}
return Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB);
};
Is this a bug or a feature?
I am expecting it to work like this:
Math.ceil(size / 1000 * (feePerKb || Transaction.FEE_PER_KB));
instead of
Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB);
I was about to make an issue about the same thing
+1