From e0c0815c96390f7bd806e8af84f98ffbb2be9e5e Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 13 Jun 2023 16:45:09 -0600 Subject: [PATCH] invoices: allow overpayment in mpps --- invoices/update.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/invoices/update.go b/invoices/update.go index 390f325a7..ed60c278c 100644 --- a/invoices/update.go +++ b/invoices/update.go @@ -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 }