channeldb+invoice: add state filter to HTLCSet

This commit is contained in:
Conner Fromknecht committed 2021-05-10 16:55:17 -07:00
1 parent 620e426bc3
commit d93c3298b7
3 files changed
+16 -17

No files matched your search

+2 -2
View File
@@ -168,7 +168,7 @@ func updateMpp(ctx *invoiceUpdateCtx,
return nil, ctx.failRes(ResultHtlcSetTotalTooLow), nil
}
htlcSet := inv.HTLCSet(setID)
htlcSet := inv.HTLCSet(setID, channeldb.HtlcStateAccepted)
// Check whether total amt matches other htlcs in the set.
var newSetTotal lnwire.MilliSatoshi
@@ -373,7 +373,7 @@ func updateLegacy(ctx *invoiceUpdateCtx,
// Don't allow settling the invoice with an old style
// htlc if we are already in the process of gathering an
// mpp set.
for _, htlc := range inv.HTLCSet(nil) {
for _, htlc := range inv.HTLCSet(nil, channeldb.HtlcStateAccepted) {
if htlc.MppTotalAmt > 0 {
return nil, ctx.failRes(ResultMppInProgress), nil
}