mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-21 14:10:35 +02:00
invoices: remove redundant code
HTLCSet already removes any HTLCs that are not in the desired state, so doing it again on the same set is redundant.
This commit is contained in:
@@ -196,13 +196,6 @@ func updateMpp(ctx *invoiceUpdateCtx,
|
|||||||
// Check whether total amt matches other htlcs in the set.
|
// Check whether total amt matches other htlcs in the set.
|
||||||
var newSetTotal lnwire.MilliSatoshi
|
var newSetTotal lnwire.MilliSatoshi
|
||||||
for _, htlc := range htlcSet {
|
for _, htlc := range htlcSet {
|
||||||
// Only consider accepted mpp htlcs. It is possible that there
|
|
||||||
// are htlcs registered in the invoice database that previously
|
|
||||||
// timed out and are in the canceled state now.
|
|
||||||
if htlc.State != channeldb.HtlcStateAccepted {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if ctx.mpp.TotalMsat() != htlc.MppTotalAmt {
|
if ctx.mpp.TotalMsat() != htlc.MppTotalAmt {
|
||||||
return nil, ctx.failRes(ResultHtlcSetTotalMismatch), nil
|
return nil, ctx.failRes(ResultHtlcSetTotalMismatch), nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user