lnwallet/btcwallet: properly pass in FeeEstimator to btcwallet

This commit fixes a bug wherein the wallet would use the default relay
fee to craft transactions. On testnet, this might be insufficient or be
rejected all together in a mainnet setting. Therefore, we now pass in
the FeeEstimator interface and ensure that it’s consulted in order to
set the relay fee the wallet will use to craft transactions.

Note that this is a hold over until we have true dynamic fee
calculation within lnd which can then be extended to the internal
wallets.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-06-07 17:01:27 -07:00
1 parent 5adbc7fae3
commit dc40662770
3 files changed
+21 -6

No files matched your search

+4 -3
View File
@@ -83,9 +83,10 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB) (*chainControl
estimator := lnwallet.StaticFeeEstimator{FeeRate: 50}
walletConfig := &btcwallet.Config{
PrivatePass: []byte("hello"),
DataDir: homeChainConfig.ChainDir,
NetParams: activeNetParams.Params,
PrivatePass: []byte("hello"),
DataDir: homeChainConfig.ChainDir,
NetParams: activeNetParams.Params,
FeeEstimator: estimator,
}
cc := &chainControl{