5f0fad85be
In this commit, we fix a lingering TOOD statement in the channel arb. Before this commitment, we would simply wipe our our local HTLC set of the HTLC set that was on the remote commitment transaction on force close. This was incorrect as if our commitment transaction had an HTLC that the remote commitment didn't, then we would fail to cancel that back, and cause both channels to time out on chain. In order to remedy this, we introduce a new `HtlcSetKey` struct to track all 3 possible in-flight set of HTLCs: ours, theirs, and their pending. We also we start to tack on additional data to all the unilateral close messages we send to subscribers. This new data is the CommitSet, or the set of valid commitments at channel closure time. This new information will be used by the channel arb in an upcoming commit to ensure it will cancel back HTLCs in the case of split commitment state. Finally, we start to thread through an optional *CommitSet to the advanceState method. This additional information will give the channel arb addition information it needs to ensure it properly cancels back HTLCs that are about to time out or may time out depending on which commitment is played. Within the htlcswitch pakage, we modify the `SignNextCommitment` method to return the new set of pending HTLCs for the remote party's commitment transaction and `ReceiveRevocation` to return the latest set of commitment transactions on the remote party's commitment as well. This is a preparatory change which is part of a larger change to address a lingering TODO in the cnct. Additionally, rather than just send of the set of HTLCs after the we revoke, we'll also send of the set of HTLCs after the remote party revokes, and we create a pending commitment state for it. |
||
---|---|---|
.. | ||
briefcase_test.go | ||
briefcase.go | ||
chain_arbitrator_test.go | ||
chain_arbitrator.go | ||
chain_watcher_test.go | ||
chain_watcher.go | ||
channel_arbitrator_test.go | ||
channel_arbitrator.go | ||
commit_sweep_resolver.go | ||
contract_resolvers.go | ||
htlc_incoming_contest_resolver.go | ||
htlc_incoming_resolver_test.go | ||
htlc_outgoing_contest_resolver.go | ||
htlc_success_resolver.go | ||
htlc_timeout_resolver_test.go | ||
htlc_timeout_resolver.go | ||
interfaces.go | ||
log.go | ||
mock_registry_test.go | ||
utils_test.go |