lnwallet: correct BTC -> SAT conversion in BtcdFeeEstimator
In this commit, we correct the BTC -> SAT conversion in BtcdFeeEstimator. Previously, we use 10e8 instead of 1e8, causing us to be off by an order of magnitude.
This commit is contained in:
1 file changed
+5
-2
@@ -173,12 +173,15 @@ func (b *BtcdFeeEstimator) fetchEstimatePerByte(confTarget uint32) (btcutil.Amou
|
|||||||
|
|
||||||
// Next, we'll convert the returned value to satoshis, as it's
|
// Next, we'll convert the returned value to satoshis, as it's
|
||||||
// currently returned in BTC.
|
// currently returned in BTC.
|
||||||
satPerKB := uint64(btcPerKB * 10e8)
|
satPerKB, err := btcutil.NewAmount(btcPerKB)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
// The value returned is expressed in fees per KB, while we want
|
// 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 1024 to map to satoshis-per-byte
|
||||||
// before returning the estimate.
|
// before returning the estimate.
|
||||||
satPerByte := btcutil.Amount(satPerKB / 1024)
|
satPerByte := satPerKB / 1024
|
||||||
|
|
||||||
walletLog.Debugf("Returning %v sat/byte for conf target of %v",
|
walletLog.Debugf("Returning %v sat/byte for conf target of %v",
|
||||||
int64(satPerByte), confTarget)
|
int64(satPerByte), confTarget)
|
||||||
|
|||||||
Reference in new issue
Block a user