channeldb: return full payment for inflight payments

We might as well return all info, and we'll need the individual HTLCs
in later commits.
This commit is contained in:
Johan T. Halseth
2021-03-30 12:10:30 +02:00
parent 8af00ab0cf
commit 7795353e9f
4 changed files with 21 additions and 32 deletions

View File

@@ -583,14 +583,7 @@ func (r *ChannelRouter) Start() error {
// until the cleaning has finished.
toKeep := make(map[uint64]struct{})
for _, p := range payments {
payment, err := r.cfg.Control.FetchPayment(
p.Info.PaymentHash,
)
if err != nil {
return err
}
for _, a := range payment.HTLCs {
for _, a := range p.HTLCs {
toKeep[a.AttemptID] = struct{}{}
}
}
@@ -603,7 +596,7 @@ func (r *ChannelRouter) Start() error {
for _, payment := range payments {
log.Infof("Resuming payment with hash %v", payment.Info.PaymentHash)
r.wg.Add(1)
go func(payment *channeldb.InFlightPayment) {
go func(payment *channeldb.MPPayment) {
defer r.wg.Done()
// We create a dummy, empty payment session such that