lnd.xprv/htlcswitch
Juan Pablo Civile a10c96a63b htlcswitch: set sourceRef when resolving packets through interceptor
Having it set to nil caused https://github.com/lightningnetwork/lnd/issues/5115

The problem was several layers removed from the fix. The link decides to
clean up a `fwdPkg` only if it's completed, otherwise it renotifies the
HTLCs. A package is only set to complete if it's `addAck` and
`settleFail` filters are full. For forwarded HTLCs, the `addAck` was
never being set so it would never be considered complete under this
criteria.

`addAck` is set for an HTLC when signing the next commitment TX in the
`LightningChannel`. The path for this is:
* `LightningChannel#SettleHtlc` adds the HTLC to `localUpdates`
* `LightningChannel#SignNextCommitment` builds the `ackAddRef` for all
updates with `SourceRef != nil`.
* `LightningChannel#SignNextCommitment` then passes the list of
`ackAddRef` to `OpenChannel#AppendRemoteCommitChain` to persist the new
acks in the filter

Since `SourceRef` was nil for interceptor packages, `SignNextCommitment`
ignored it and the ack was never persisted.
2021-05-07 10:31:22 -03:00
..
hodl htlcswitch/hodl: switch from debug tag to dev 2018-10-05 13:04:45 +09:00
hop htlcswitch/hop: parse and validate AMP records 2021-04-07 12:08:33 -07:00
circuit_map.go multi: add reset closure to kvdb.Update 2020-11-05 17:57:12 +01:00
circuit_test.go server+mod: use ECDH interface for sphinx router 2020-05-20 09:05:36 +02:00
circuit.go htlcswitch: move hop iterator into htlcswitch/hop package 2019-09-05 15:30:31 +02:00
decayedlog_test.go server+htlcswitch: auto compact sphinx DB too 2020-11-13 10:19:51 +01:00
decayedlog.go kvdb: add timeout options for bbolt (#4787) 2020-12-07 15:31:49 -08:00
failure_detail.go htlcswitch: add linkError field to htlcpacket 2020-02-06 19:43:29 +02:00
failure.go htlcswitch: add linkError field to htlcpacket 2020-02-06 19:43:29 +02:00
htlcnotifier.go channelnotifier+discover+invoices: return error in Stop functions 2021-04-13 13:26:01 +03:00
interceptable_switch.go htlcswitch: set sourceRef when resolving packets through interceptor 2021-05-07 10:31:22 -03:00
interfaces.go watchtower/wtclient: parameterize backup task with channel type 2020-11-25 15:04:12 -08:00
link_isolated_test.go htlcswitch/test: add test cases that triggers empty commit sig 2019-11-06 09:21:21 +01:00
link_test.go htlcswitch: init mockFeeEstimator in other LinkChannelConfigs 2021-02-15 12:14:32 -08:00
link.go multi: cap anchors feerate at configurable maximum 2020-12-15 19:54:50 +01:00
linkfailure.go htlcswitch: add PermanentFailure to LinkFailureError 2020-11-04 10:50:28 +01:00
log.go htlcswitch/hop: fix logging 2019-09-09 13:52:35 +02:00
mailbox_test.go htlcswitch: change ForwardPackets to return error 2020-06-18 12:48:21 +03:00
mailbox.go htlcswitch: change ForwardPackets to return error 2020-06-18 12:48:21 +03:00
mock.go htlcswitch: init mockFeeEstimator in other LinkChannelConfigs 2021-02-15 12:14:32 -08:00
packet.go htlcswitch: expose custom records on intercepted packet 2020-06-27 11:00:46 +02:00
payment_result_test.go lnwire: prep wire messages for TLV extensions 2021-02-24 17:31:55 +01:00
payment_result.go channeldb+htlcswitch: write wire messages using length prefix 2021-02-24 17:15:27 +01:00
sequencer.go multi: add reset closure to kvdb.Update 2020-11-05 17:57:12 +01:00
switch_test.go channelnotifier+discover+invoices: return error in Stop functions 2021-04-13 13:26:01 +03:00
switch.go router+switch: rename paymentID->attemptID 2021-04-27 08:27:33 +02:00
test_utils.go htlcswitch: init mockFeeEstimator in other LinkChannelConfigs 2021-02-15 12:14:32 -08:00