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
2024-01-16 11:37:16 +01:00
parent 34af399a5b
commit 79fb45074b
4 changed files with 19 additions and 1 deletions

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,