From 4ba01bb558f5fe9cb333c2cb723a06e903f57181 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 16 May 2017 19:01:57 -0700 Subject: [PATCH] lnwallet: correct scaling for fee-per-byte to fee-per-weight, divide by 4 This commit corrects an error in the scaling as currently implemented in the default static fee estimator. The spec draft has an error and erroneously recommends multiplying by 4 to arrive at the fee-per-weight from the fee-per-byte. This is incorrect as with the segwit block-size increase, the ratio is 1/4 rather than 4. --- lnwallet/wallet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index 0252528f..04838982 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -1467,7 +1467,7 @@ func (e StaticFeeEstimator) EstimateFeePerByte(numBlocks uint32) uint64 { // EstimateFeePerWeight will return a static value for fee calculations. func (e StaticFeeEstimator) EstimateFeePerWeight(numBlocks uint32) uint64 { - return e.FeeRate * 4 + return e.FeeRate / 4 } // EstimateConfirmation will return a static value representing the estimated