From 16aad1a9eea7bfb4590d4285953adc475960765c Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 12 Apr 2019 14:13:48 -0700 Subject: [PATCH] lnwallet+chainregistry: remove unused FeeEstimator from wallet cfg --- chainregistry.go | 1 - lnwallet/btcwallet/config.go | 6 ------ lnwallet/interface_test.go | 42 +++++++++++------------------------- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/chainregistry.go b/chainregistry.go index dea7cd8c..71137e6a 100644 --- a/chainregistry.go +++ b/chainregistry.go @@ -178,7 +178,6 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB, RecoveryWindow: recoveryWindow, DataDir: homeChainConfig.ChainDir, NetParams: activeNetParams.Params, - FeeEstimator: cc.feeEstimator, CoinType: activeNetParams.CoinType, Wallet: wallet, } diff --git a/lnwallet/btcwallet/config.go b/lnwallet/btcwallet/config.go index b52b966f..ea948e8a 100644 --- a/lnwallet/btcwallet/config.go +++ b/lnwallet/btcwallet/config.go @@ -7,7 +7,6 @@ import ( "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" - "github.com/lightningnetwork/lnd/lnwallet" "github.com/btcsuite/btcwallet/chain" "github.com/btcsuite/btcwallet/wallet" @@ -79,11 +78,6 @@ type Config struct { // notifications for received funds, etc. ChainSource chain.Interface - // FeeEstimator is an instance of the fee estimator interface which - // will be used by the wallet to dynamically set transaction fees when - // crafting transactions. - FeeEstimator lnwallet.FeeEstimator - // NetParams is the net parameters for the target chain. NetParams *chaincfg.Params diff --git a/lnwallet/interface_test.go b/lnwallet/interface_test.go index de496d66..4d30d07f 100644 --- a/lnwallet/interface_test.go +++ b/lnwallet/interface_test.go @@ -2646,8 +2646,6 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver, aliceWalletController lnwallet.WalletController bobWalletController lnwallet.WalletController - - feeEstimator lnwallet.FeeEstimator ) tempTestDirAlice, err := ioutil.TempDir("", "lnwallet") @@ -2668,12 +2666,6 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver, var aliceClient, bobClient chain.Interface switch backEnd { case "btcd": - feeEstimator, err = lnwallet.NewBtcdFeeEstimator( - rpcConfig, 250) - if err != nil { - t.Fatalf("unable to create btcd fee estimator: %v", - err) - } aliceClient, err = chain.NewRPCClient(netParams, rpcConfig.Host, rpcConfig.User, rpcConfig.Pass, rpcConfig.Certificates, false, 20) @@ -2688,8 +2680,6 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver, } case "neutrino": - feeEstimator = lnwallet.NewStaticFeeEstimator(62500, 0) - // Set some package-level variable to speed up // operation for tests. neutrino.BanDuration = time.Millisecond * 100 @@ -2751,12 +2741,6 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver, ) case "bitcoind": - feeEstimator, err = lnwallet.NewBitcoindFeeEstimator( - rpcConfig, 250) - if err != nil { - t.Fatalf("unable to create bitcoind fee estimator: %v", - err) - } // Start a bitcoind instance. tempBitcoindDir, err := ioutil.TempDir("", "bitcoind") if err != nil { @@ -2819,13 +2803,12 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver, aliceSeedBytes := aliceSeed.Sum(nil) aliceWalletConfig := &btcwallet.Config{ - PrivatePass: []byte("alice-pass"), - HdSeed: aliceSeedBytes, - DataDir: tempTestDirAlice, - NetParams: netParams, - ChainSource: aliceClient, - FeeEstimator: feeEstimator, - CoinType: keychain.CoinTypeTestnet, + PrivatePass: []byte("alice-pass"), + HdSeed: aliceSeedBytes, + DataDir: tempTestDirAlice, + NetParams: netParams, + ChainSource: aliceClient, + CoinType: keychain.CoinTypeTestnet, } aliceWalletController, err = walletDriver.New(aliceWalletConfig) if err != nil { @@ -2843,13 +2826,12 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver, bobSeedBytes := bobSeed.Sum(nil) bobWalletConfig := &btcwallet.Config{ - PrivatePass: []byte("bob-pass"), - HdSeed: bobSeedBytes, - DataDir: tempTestDirBob, - NetParams: netParams, - ChainSource: bobClient, - FeeEstimator: feeEstimator, - CoinType: keychain.CoinTypeTestnet, + PrivatePass: []byte("bob-pass"), + HdSeed: bobSeedBytes, + DataDir: tempTestDirBob, + NetParams: netParams, + ChainSource: bobClient, + CoinType: keychain.CoinTypeTestnet, } bobWalletController, err = walletDriver.New(bobWalletConfig) if err != nil {