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 committed 2021-04-27 08:27:32 +02:00
1 parent 8af00ab0cf
commit 7795353e9f
4 files changed
+21 -32

No files matched your search

+2 -9
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