routerrpc: use cltv delta default for buildroute.

This commit uses the default timelock delta (cltv delta) when
no value is provided for the buildroute rpc cmd.
Moreover it enhances the docs.
This commit is contained in:
ziggie committed 2024-01-16 14:08:51 +01:00
1 parent 34af399a5b
commit 79fb45074b
4 files changed
+19 -1

No files matched your search

+6
View File
@@ -999,6 +999,12 @@ func (s *Server) BuildRoute(ctx context.Context,
payAddr = &backingPayAddr
}
if req.FinalCltvDelta == 0 {
req.FinalCltvDelta = int32(
s.cfg.RouterBackend.DefaultFinalCltvDelta,
)
}
// Build the route and return it to the caller.
route, err := s.cfg.Router.BuildRoute(
amt, hops, outgoingChan, req.FinalCltvDelta, payAddr,