Skip to content

Commit

Permalink
mempool: switch fee estimation to use vsize as a base
Browse files Browse the repository at this point in the history
In this commit, we modify the fee estimation to use vsize as a base
rather than size. A recent commit landed to track the fee rate using
vsize in the mempool, and also correct some incorrect unit math. This is
a follow up to that commit to ensure that fee estimation is uniform
throughout. To do so, we'll use the KeePerKB directly from the mempool's
TxDesc.
  • Loading branch information
Roasbeef committed Feb 21, 2018
1 parent e6807bc commit 0dcaa7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mempool/estimatefee.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ func (ef *FeeEstimator) ObserveTransaction(t *TxDesc) {

hash := *t.Tx.Hash()
if _, ok := ef.observed[hash]; !ok {
size := uint32(t.Tx.MsgTx().SerializeSize())

ef.observed[hash] = &observedTransaction{
hash: hash,
feeRate: NewSatoshiPerByte(btcutil.Amount(t.Fee), size),
hash: hash,
// We'll map the fee per KB back into fee per byte by
// diving by 1000.
feeRate: SatoshiPerByte(t.FeePerKB / 1000),
observed: t.Height,
mined: mining.UnminedHeight,
}
Expand Down

0 comments on commit 0dcaa7f

Please sign in to comment.