1
0

Merge pull request #10364 from f321x/test_dont_settle_htlcs_forwarding

lnpeer/lnworker: check dont_settle_htlcs when forwarding
This commit is contained in:
ghost43
2025-12-30 16:13:16 +00:00
committed by GitHub
2 changed files with 79 additions and 75 deletions

View File

@@ -2306,8 +2306,6 @@ class Peer(Logger, EventListener):
local_height = self.network.blockchain().height()
payment_hash = htlc_set.get_payment_hash()
assert payment_hash is not None, "Empty htlc set?"
self.lnworker.dont_expire_htlcs.pop(payment_hash.hex(), None)
self.lnworker.dont_settle_htlcs.pop(payment_hash.hex(), None) # already failed
for mpp_htlc in list(htlc_set.htlcs):
chan = self.get_channel_by_id(mpp_htlc.channel_id)
htlc_id = mpp_htlc.htlc.htlc_id
@@ -3230,7 +3228,10 @@ class Peer(Logger, EventListener):
# this was a forwarding set and it failed
self.lnworker.set_mpp_resolution(payment_key, RecvMPPResolution.FAILED)
return error_bytes or failure_message, None, None
preimage = self.lnworker.get_preimage(mpp_set.get_payment_hash())
payment_hash = mpp_set.get_payment_hash()
if payment_hash.hex() in self.lnworker.dont_settle_htlcs:
return None, None, None
preimage = self.lnworker.get_preimage(payment_hash)
return None, preimage, None
return None