diff --git a/channeldb/payment_control.go b/channeldb/payment_control.go index 5a538134..d67b0a8e 100644 --- a/channeldb/payment_control.go +++ b/channeldb/payment_control.go @@ -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 { // Info is the PaymentCreationInfo of the in-flight payment. 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. @@ -718,33 +713,6 @@ func (p *PaymentControl) FetchInFlightPayments() ([]*InFlightPayment, error) { 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) return nil }) diff --git a/routing/mock_test.go b/routing/mock_test.go index e2f46687..f5a6d382 100644 --- a/routing/mock_test.go +++ b/routing/mock_test.go @@ -446,13 +446,8 @@ func (m *mockControlTower) FetchInFlightPayments() ( continue } - var attempts []channeldb.HTLCAttemptInfo - for _, a := range p.attempts { - attempts = append(attempts, a.HTLCAttemptInfo) - } ifl := channeldb.InFlightPayment{ - Info: &p.info, - Attempts: attempts, + Info: &p.info, } fl = append(fl, &ifl)