sweep: embed input.Input interface
Get rid of needless referencing of the embedded object.
This commit is contained in:
parent
38adfd7ecc
commit
071c57d4a4
@ -70,16 +70,15 @@ type Params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// pendingInput is created when an input reaches the main loop for the first
|
// pendingInput is created when an input reaches the main loop for the first
|
||||||
// time. It tracks all relevant state that is needed for sweeping.
|
// time. It wraps the input and tracks all relevant state that is needed for
|
||||||
|
// sweeping.
|
||||||
type pendingInput struct {
|
type pendingInput struct {
|
||||||
|
input.Input
|
||||||
|
|
||||||
// listeners is a list of channels over which the final outcome of the
|
// listeners is a list of channels over which the final outcome of the
|
||||||
// sweep needs to be broadcasted.
|
// sweep needs to be broadcasted.
|
||||||
listeners []chan Result
|
listeners []chan Result
|
||||||
|
|
||||||
// input is the original struct that contains the input and sign
|
|
||||||
// descriptor.
|
|
||||||
input input.Input
|
|
||||||
|
|
||||||
// ntfnRegCancel is populated with a function that cancels the chain
|
// ntfnRegCancel is populated with a function that cancels the chain
|
||||||
// notifier spend registration.
|
// notifier spend registration.
|
||||||
ntfnRegCancel func()
|
ntfnRegCancel func()
|
||||||
@ -474,7 +473,7 @@ func (s *UtxoSweeper) collector(blockEpochs <-chan *chainntnfs.BlockEpoch) {
|
|||||||
// channel will be appended to this slice.
|
// channel will be appended to this slice.
|
||||||
pendInput = &pendingInput{
|
pendInput = &pendingInput{
|
||||||
listeners: []chan Result{input.resultChan},
|
listeners: []chan Result{input.resultChan},
|
||||||
input: input.input,
|
Input: input.input,
|
||||||
minPublishHeight: bestHeight,
|
minPublishHeight: bestHeight,
|
||||||
params: input.params,
|
params: input.params,
|
||||||
}
|
}
|
||||||
@ -800,9 +799,9 @@ func (s *UtxoSweeper) getInputLists(cluster inputCluster,
|
|||||||
|
|
||||||
// Add input to the either one of the lists.
|
// Add input to the either one of the lists.
|
||||||
if input.publishAttempts == 0 {
|
if input.publishAttempts == 0 {
|
||||||
newInputs = append(newInputs, input.input)
|
newInputs = append(newInputs, input)
|
||||||
} else {
|
} else {
|
||||||
retryInputs = append(retryInputs, input.input)
|
retryInputs = append(retryInputs, input)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1002,12 +1001,12 @@ func (s *UtxoSweeper) handlePendingSweepsReq(
|
|||||||
for _, pendingInput := range s.pendingInputs {
|
for _, pendingInput := range s.pendingInputs {
|
||||||
// Only the exported fields are set, as we expect the response
|
// Only the exported fields are set, as we expect the response
|
||||||
// to only be consumed externally.
|
// to only be consumed externally.
|
||||||
op := *pendingInput.input.OutPoint()
|
op := *pendingInput.OutPoint()
|
||||||
pendingInputs[op] = &PendingInput{
|
pendingInputs[op] = &PendingInput{
|
||||||
OutPoint: op,
|
OutPoint: op,
|
||||||
WitnessType: pendingInput.input.WitnessType(),
|
WitnessType: pendingInput.WitnessType(),
|
||||||
Amount: btcutil.Amount(
|
Amount: btcutil.Amount(
|
||||||
pendingInput.input.SignDesc().Output.Value,
|
pendingInput.SignDesc().Output.Value,
|
||||||
),
|
),
|
||||||
LastFeeRate: pendingInput.lastFeeRate,
|
LastFeeRate: pendingInput.lastFeeRate,
|
||||||
BroadcastAttempts: pendingInput.publishAttempts,
|
BroadcastAttempts: pendingInput.publishAttempts,
|
||||||
|
Loading…
Reference in New Issue
Block a user