routerrpc+cmd: use skip_temp_err when sending to route

This commit is contained in:
yyforyongyu committed 2022-07-15 19:03:12 +08:00
1 parent 46ca28fe22
commit 07e9adfd8c
2 files changed
+15 -1

No files matched your search

+7 -1
View File
@@ -399,13 +399,19 @@ func (s *Server) SendToRouteV2(ctx context.Context,
return nil, err
}
var attempt *channeldb.HTLCAttempt
// Pass route to the router. This call returns the full htlc attempt
// information as it is stored in the database. It is possible that both
// the attempt return value and err are non-nil. This can happen when
// the attempt was already initiated before the error happened. In that
// case, we give precedence to the attempt information as stored in the
// db.
attempt, err := s.cfg.Router.SendToRoute(hash, route)
if req.SkipTempErr {
attempt, err = s.cfg.Router.SendToRouteSkipTempErr(hash, route)
} else {
attempt, err = s.cfg.Router.SendToRoute(hash, route)
}
if attempt != nil {
rpcAttempt, err := s.cfg.RouterBackend.MarshalHTLCAttempt(
*attempt,