mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02: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
5
lnd.go
5
lnd.go
@ -149,11 +149,12 @@ func lndMain() error {
|
||||
signer := wc
|
||||
bio := wc
|
||||
fundingSigner := wc
|
||||
estimator := lnwallet.StaticFeeEstimator{FeeRate: 250}
|
||||
|
||||
// Create, and start the lnwallet, which handles the core payment
|
||||
// channel logic, and exposes control via proxy state machines.
|
||||
wallet, err := lnwallet.NewLightningWallet(chanDB, notifier, wc, signer,
|
||||
bio, activeNetParams.Params)
|
||||
bio, estimator, activeNetParams.Params)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to create wallet: %v\n", err)
|
||||
return err
|
||||
@ -191,7 +192,7 @@ func lndMain() error {
|
||||
// With all the relevant chains initialized, we can finally start the
|
||||
// server itself.
|
||||
server, err := newServer(defaultListenAddrs, notifier, bio,
|
||||
fundingSigner, wallet, chanDB, chainView)
|
||||
fundingSigner, wallet, estimator, chanDB, chainView)
|
||||
if err != nil {
|
||||
srvrLog.Errorf("unable to create server: %v\n", err)
|
||||
return err
|
||||
|
Reference in New Issue
Block a user