bitcore-lib
bitcore-lib copied to clipboard
Transaction fee estimate uses 1KB as smallest tx size
https://github.com/bitpay/bitcore-lib/blob/master/lib/transaction/transaction.js#L917
Math.ceil(size / 1000)
returns 1
for transactions with size < 1KB. This will estimate a unnecessary high fee for small txs - average tx size is around 530 bytes these days
Could use some clarification here regarding how miners calculate the fees, but there may be an 1kb increment.
Would https://github.com/bitcoin/bitcoin/issues/7633 help in making that decision? Rounding is gone for some time, it seems likely that miners are not considering rounded fees as well. Maybe initially this should be a new parameter, e.g. tx.feePerKb(amount, true)
(true
being use exact rate, false
/ undefined
being the default as don't use exact rate and round it instead)?