routing: always update payment in the same goroutine
This commit refactors `collectResultAsync` such that this method is now only responsible for collecting results from the switch. The method `decideNextStep` is expanded to process these results in the same goroutine where we fetch the payment from db, to make sure the lifecycle loop always have a consistent view of a given payment.
This commit is contained in:
3 files changed
+405
-152
No files matched your search
+1
-1
@@ -1186,7 +1186,7 @@ func (r *ChannelRouter) sendToRoute(htlcHash lntypes.Hash, rt *route.Route,
|
||||
|
||||
// The attempt was successfully sent, wait for the result to be
|
||||
// available.
|
||||
result, err = p.collectResult(attempt)
|
||||
result, err = p.collectAndHandleResult(attempt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user