mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-13 12:32:48 +02:00
Store held forwards as off-chain or on-chain entries instead of a raw
InterceptedForward map. Off-chain entries keep the existing resume, fail,
settle and auto-fail behavior. On-chain entries are settle-only and
expire by pruning local interceptor state.
When contractcourt re-offers a circuit that is already held off-chain,
replace the stored entry with the on-chain forward so a later SETTLE
reaches the witness beacon instead of the old link mailbox path.
Also set the on-chain interceptor deadline to the HTLC refund timeout.
This keeps the public interceptor deadline populated while ensuring only
off-chain held entries use that value to fail back.
Only off-chain held HTLCs can be released when an optional interceptor
disconnects, because they can resume into the link forwarding flow.
On-chain held HTLCs have no link flow to resume. Keep them in the held
set so a reconnecting interceptor can replay and settle them while
contractcourt waits for the preimage or on-chain expiry.
Use distinct internal deadline types for off-chain auto-fail heights and
on-chain settlement deadlines instead of overloading the intercepted packet
field.
Project both variants back into the existing router RPC auto_fail_height
field to preserve wire compatibility. Reject mismatched held HTLC deadline
types in tests.
On-chain intercepted HTLCs can only be settled. Resume and fail actions
already return concrete errors through the on-chain intercepted forward, so
let those errors propagate to the interceptor client instead of converting
them to success.
Keep the held entry tracked on these errors so the client can reconnect and
settle the HTLC later.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| hodl | ||
| hop | ||
| testdata | ||
| circuit.go | ||
| circuit_map.go | ||
| circuit_map_test.go | ||
| circuit_test.go | ||
| decayedlog.go | ||
| decayedlog_test.go | ||
| failure.go | ||
| failure_detail.go | ||
| failure_test.go | ||
| held_htlc_set.go | ||
| held_htlc_set_test.go | ||
| htlcnotifier.go | ||
| interceptable_switch.go | ||
| interfaces.go | ||
| link.go | ||
| link_isolated_test.go | ||
| link_test.go | ||
| linkfailure.go | ||
| log.go | ||
| mailbox.go | ||
| mailbox_test.go | ||
| mock.go | ||
| packet.go | ||
| payment_result.go | ||
| payment_result_test.go | ||
| quiescer.go | ||
| quiescer_test.go | ||
| resolution_store.go | ||
| resolution_store_test.go | ||
| sequencer.go | ||
| switch.go | ||
| switch_test.go | ||
| test_utils.go | ||