mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-11 06:37:21 +01:00
lnwallet: add FeeEstimator interface, StaticFeeEstimator implementation
This commit adds the FeeEstimator interface, which can be used for future fee calculation implementations. Currently, there is only the StaticFeeEstimator implementation, which returns the same fee rate for any transaction.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
320bed7e6b
commit
abe2e502d5
@@ -302,6 +302,26 @@ type MessageSigner interface {
|
||||
SignMessage(pubKey *btcec.PublicKey, msg []byte) (*btcec.Signature, error)
|
||||
}
|
||||
|
||||
// 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).
|
||||
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
|
||||
|
||||
// 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
|
||||
|
||||
// EstimateConfirmation will return the number of blocks expected for a
|
||||
// transaction to be confirmed given a fee rate in satoshis per
|
||||
// byte.
|
||||
EstimateConfirmation(satPerByte int64) uint32
|
||||
}
|
||||
|
||||
// WalletDriver represents a "driver" for a particular concrete
|
||||
// WalletController implementation. A driver is identified by a globally unique
|
||||
// string identifier along with a 'New()' method which is responsible for
|
||||
|
||||
Reference in New Issue
Block a user