mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-21 06:06:20 +02:00
sweep+cnct+nursery+rpc: extract DetermineFeePerKw to func, add FeePreference
In this commit, we extract the existing determineFeePerKw method on the RPC server into a new file in the sweep package. Along the way, we consolidate code by introducing a new FeePreference struct, which allows the caller to express their fee preference either in blocks to confirmation, or a direct fee rate. This move takes a small step to father decoupling calls in the main RPC server.
This commit is contained in:
@@ -476,7 +476,10 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) {
|
||||
// TODO: Use time-based sweeper and result chan.
|
||||
var err error
|
||||
h.sweepTx, err = h.Sweeper.CreateSweepTx(
|
||||
[]sweep.Input{&input}, sweepConfTarget, 0,
|
||||
[]sweep.Input{&input},
|
||||
sweep.FeePreference{
|
||||
ConfTarget: sweepConfTarget,
|
||||
}, 0,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1270,7 +1273,10 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
|
||||
//
|
||||
// TODO: Use time-based sweeper and result chan.
|
||||
c.sweepTx, err = c.Sweeper.CreateSweepTx(
|
||||
[]sweep.Input{&input}, sweepConfTarget, 0,
|
||||
[]sweep.Input{&input},
|
||||
sweep.FeePreference{
|
||||
ConfTarget: sweepConfTarget,
|
||||
}, 0,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user