mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
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:
parent
b596eabab3
commit
e772f8ccfa
14 changed files with 260 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue