payment_control: remove unused Attempts field
This commit is contained in:
parent
46225e2921
commit
d1a118388d
@ -673,16 +673,11 @@ func ensureInFlight(payment *MPPayment) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// InFlightPayment is a wrapper around a payment that has status InFlight.
|
// InFlightPayment is a wrapper around the info for a payment that has status
|
||||||
|
// InFlight.
|
||||||
type InFlightPayment struct {
|
type InFlightPayment struct {
|
||||||
// Info is the PaymentCreationInfo of the in-flight payment.
|
// Info is the PaymentCreationInfo of the in-flight payment.
|
||||||
Info *PaymentCreationInfo
|
Info *PaymentCreationInfo
|
||||||
|
|
||||||
// Attempts is the set of payment attempts that was made to this
|
|
||||||
// payment hash.
|
|
||||||
//
|
|
||||||
// NOTE: Might be empty.
|
|
||||||
Attempts []HTLCAttemptInfo
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FetchInFlightPayments returns all payments with status InFlight.
|
// FetchInFlightPayments returns all payments with status InFlight.
|
||||||
@ -718,33 +713,6 @@ func (p *PaymentControl) FetchInFlightPayments() ([]*InFlightPayment, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
htlcsBucket := bucket.NestedReadBucket(
|
|
||||||
paymentHtlcsBucket,
|
|
||||||
)
|
|
||||||
if htlcsBucket == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch all HTLCs attempted for this payment.
|
|
||||||
htlcs, err := fetchHtlcAttempts(htlcsBucket)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// We only care about the static info for the HTLCs
|
|
||||||
// still in flight, so convert the result to a slice of
|
|
||||||
// HTLCAttemptInfos.
|
|
||||||
for _, h := range htlcs {
|
|
||||||
// Skip HTLCs not in flight.
|
|
||||||
if h.Settle != nil || h.Failure != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
inFlight.Attempts = append(
|
|
||||||
inFlight.Attempts, h.HTLCAttemptInfo,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
inFlights = append(inFlights, inFlight)
|
inFlights = append(inFlights, inFlight)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
@ -446,13 +446,8 @@ func (m *mockControlTower) FetchInFlightPayments() (
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
var attempts []channeldb.HTLCAttemptInfo
|
|
||||||
for _, a := range p.attempts {
|
|
||||||
attempts = append(attempts, a.HTLCAttemptInfo)
|
|
||||||
}
|
|
||||||
ifl := channeldb.InFlightPayment{
|
ifl := channeldb.InFlightPayment{
|
||||||
Info: &p.info,
|
Info: &p.info,
|
||||||
Attempts: attempts,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fl = append(fl, &ifl)
|
fl = append(fl, &ifl)
|
||||||
|
Loading…
Reference in New Issue
Block a user