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:
bryanvu authored and Olaoluwa Osuntokun committed 2017-05-15 20:26:11 -07:00
1 parent 320bed7e6b
commit abe2e502d5
11 files changed
+100 -25

No files matched your search

+3 -2
View File
@@ -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