From 63fe8aec5be41a2c43c517188f9cc6253374f2b1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 28 Jan 2018 14:53:53 -0800 Subject: [PATCH] lnwallet: properly use in KB, not KiB to convert to sat/byte for bitcoind estimator In this commit, we fix an existing bug. The fee estimation within bitcoind is based on fee/KB (1000), not fee/KiB (1024). Pointed out by @dabura667. --- lnwallet/fee_estimator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnwallet/fee_estimator.go b/lnwallet/fee_estimator.go index c98adf29..fa06c45c 100644 --- a/lnwallet/fee_estimator.go +++ b/lnwallet/fee_estimator.go @@ -331,9 +331,9 @@ func (b *BitcoindFeeEstimator) fetchEstimatePerByte(confTarget uint32) (btcutil. } // The value returned is expressed in fees per KB, while we want - // fee-per-byte, so we'll divide by 1024 to map to satoshis-per-byte + // fee-per-byte, so we'll divide by 1000 to map to satoshis-per-byte // before returning the estimate. - satPerByte := satPerKB / 1024 + satPerByte := satPerKB / 1000 walletLog.Debugf("Returning %v sat/byte for conf target of %v", int64(satPerByte), confTarget)