instantout: enforce the accepted swap fee

Carry the accepted quote into each request, persist it, and reject
invoices above that limit. Preserve compatibility for requests that
omit the cap while distinguishing an explicit zero.
This commit is contained in:
Slyghtning 2026-08-11 11:43:16 +02:00
parent b596eabab3
commit e772f8ccfa
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
14 changed files with 260 additions and 12 deletions

View file

@ -1763,8 +1763,15 @@ func (s *swapClientServer) InstantOut(ctx context.Context,
reservationIds[i] = resId
}
var options []instantout.NewInstantOutOption
if req.GetMaxSwapFee() != nil {
options = append(options, instantout.WithMaxSwapFee(
btcutil.Amount(req.GetMaxSwapFeeSat()),
))
}
instantOutFsm, err := s.instantOutManager.NewInstantOut(
ctx, reservationIds, req.DestAddr,
ctx, reservationIds, req.DestAddr, options...,
)
if err != nil {
return nil, err