mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
chainfee: create new chainfee package extracting fees from lnwallet
In this commit, we create a new chainfee package, that houses all fee related functionality used within the codebase. The creation of this new package furthers our long-term goal of extracting functionality from the bloated `lnwallet` package into new distinct packages. Additionally, this new packages resolves a class of import cycle that could arise if a new package that was imported by something in `lnwallet` wanted to use the existing fee related functions in the prior `lnwallet` package.
This commit is contained in:
@ -44,6 +44,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/nat"
|
||||
"github.com/lightningnetwork/lnd/netann"
|
||||
@ -1136,7 +1137,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB,
|
||||
if cfg.WtClient.SweepFeeRate != 0 {
|
||||
// We expose the sweep fee rate in sat/byte, but the
|
||||
// tower protocol operations on sat/kw.
|
||||
sweepRateSatPerByte := lnwallet.SatPerKVByte(
|
||||
sweepRateSatPerByte := chainfee.SatPerKVByte(
|
||||
1000 * cfg.WtClient.SweepFeeRate,
|
||||
)
|
||||
policy.SweepFeeRate = sweepRateSatPerByte.FeePerKWeight()
|
||||
@ -3071,7 +3072,7 @@ type openChanReq struct {
|
||||
|
||||
pushAmt lnwire.MilliSatoshi
|
||||
|
||||
fundingFeePerKw lnwallet.SatPerKWeight
|
||||
fundingFeePerKw chainfee.SatPerKWeight
|
||||
|
||||
private bool
|
||||
|
||||
|
Reference in New Issue
Block a user