mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 06:21:40 +01:00
invoices: allow overpayment in mpps
This commit is contained in:
parent
5c5ce1f707
commit
e0c0815c96
1 changed files with 1 additions and 6 deletions
|
@ -214,11 +214,6 @@ func updateMpp(ctx *invoiceUpdateCtx, inv *Invoice) (*InvoiceUpdateDesc,
|
|||
// Add amount of new htlc.
|
||||
newSetTotal += ctx.amtPaid
|
||||
|
||||
// Make sure the communicated set total isn't overpaid.
|
||||
if newSetTotal > ctx.mpp.TotalMsat() {
|
||||
return nil, ctx.failRes(ResultHtlcSetOverpayment), nil
|
||||
}
|
||||
|
||||
// The invoice is still open. Check the expiry.
|
||||
if ctx.expiry < uint32(ctx.currentHeight+ctx.finalCltvRejectDelta) {
|
||||
return nil, ctx.failRes(ResultExpiryTooSoon), nil
|
||||
|
@ -243,7 +238,7 @@ func updateMpp(ctx *invoiceUpdateCtx, inv *Invoice) (*InvoiceUpdateDesc,
|
|||
}
|
||||
|
||||
// If the invoice cannot be settled yet, only record the htlc.
|
||||
setComplete := newSetTotal == ctx.mpp.TotalMsat()
|
||||
setComplete := newSetTotal >= ctx.mpp.TotalMsat()
|
||||
if !setComplete {
|
||||
return &update, ctx.acceptRes(resultPartialAccepted), nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue