lnwallet: extend FeeEstimator methods to be able to return an error
In this commit, we extend the FeeEstimator methods to allow them to return an error. This is required as most implementations aside from the static fee estimator will want to be able to return errors to users to indicate the inability to properly estimate fees.
This commit is contained in:
parent
9b1f21e283
commit
0713c8c7ce
@ -1,5 +1,9 @@
|
||||
package lnwallet
|
||||
|
||||
import (
|
||||
"github.com/roasbeef/btcutil"
|
||||
)
|
||||
|
||||
// FeeEstimator provides the ability to estimate on-chain transaction fees for
|
||||
// various combinations of transaction sizes and desired confirmation time
|
||||
// (measured by number of blocks).
|
||||
@ -7,12 +11,12 @@ type FeeEstimator interface {
|
||||
// EstimateFeePerByte takes in a target for the number of blocks until
|
||||
// an initial confirmation and returns the estimated fee expressed in
|
||||
// satoshis/byte.
|
||||
EstimateFeePerByte(numBlocks uint32) uint64
|
||||
EstimateFeePerByte(numBlocks uint32) (btcutil.Amount, error)
|
||||
|
||||
// EstimateFeePerWeight takes in a target for the number of blocks
|
||||
// until an initial confirmation and returns the estimated fee
|
||||
// expressed in satoshis/weight.
|
||||
EstimateFeePerWeight(numBlocks uint32) uint64
|
||||
EstimateFeePerWeight(numBlocks uint32) (btcutil.Amount, error)
|
||||
}
|
||||
|
||||
// StaticFeeEstimator will return a static value for all fee calculation
|
||||
|
Loading…
Reference in New Issue
Block a user