mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
sweep: pass default deadline height when clustering inputs
This commit changes the method `ClusterInputs` to also take a default deadline height. Previously, when calculating the default deadline height for a non-time sensitive input, we would first cluster it with other non-time sensitive inputs, then give it a deadline before we are about to `sweep`. This is now moved to the step where we decide to cluster inputs, allowing time-sensitive and non-sensitive inputs to be grouped together, if they happen to share the same deadline heights.
This commit is contained in:
@ -8,7 +8,6 @@ import (
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
@ -342,8 +341,10 @@ type mockUtxoAggregator struct {
|
||||
var _ UtxoAggregator = (*mockUtxoAggregator)(nil)
|
||||
|
||||
// ClusterInputs takes a list of inputs and groups them into clusters.
|
||||
func (m *mockUtxoAggregator) ClusterInputs(inputs InputsMap) []InputSet {
|
||||
args := m.Called(inputs)
|
||||
func (m *mockUtxoAggregator) ClusterInputs(inputs InputsMap,
|
||||
defaultDeadline int32) []InputSet {
|
||||
|
||||
args := m.Called(inputs, defaultDeadline)
|
||||
|
||||
return args.Get(0).([]InputSet)
|
||||
}
|
||||
@ -484,10 +485,10 @@ func (m *MockInputSet) NeedWalletInput() bool {
|
||||
}
|
||||
|
||||
// DeadlineHeight returns the deadline height for the set.
|
||||
func (m *MockInputSet) DeadlineHeight() fn.Option[int32] {
|
||||
func (m *MockInputSet) DeadlineHeight() int32 {
|
||||
args := m.Called()
|
||||
|
||||
return args.Get(0).(fn.Option[int32])
|
||||
return args.Get(0).(int32)
|
||||
}
|
||||
|
||||
// Budget givens the total amount that can be used as fees by this input set.
|
||||
|
Reference in New Issue
Block a user