Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnwallet: ensure we reject duplicate fails and settles for HTLCs #1286

Merged

Conversation

Roasbeef
Copy link
Member

In this PR, we add a new index to the updateLog. The role of this index is to ensure that we don't accept duplicate fails or settles for a particular HTLC. Each time an HTLC is failed or settled, we'll mark it as such in this new index. If us, or the remote party attempts to modify the HTLC a second time, we'll check this index and reject the update if the HTLC has already been modified. A set of tests have been added to ensure that we'll reject live HTLCs, but also reject HTLCs during self retransmission attempts.

In this commit, we add a new index to the HTLC log. This new index is
meant to ensure that we don't attempt to modify and HTLC twice. An HTLC
modification is either a fail or a settle. This is the first in a series
of commits to fix an existing bug in the state machine that can cause a
panic if a remote node attempts to settle an HTLC twice.
@Roasbeef Roasbeef force-pushed the prevent-duplicate-htlc-mods branch from d12bf63 to 376d332 Compare May 26, 2018 03:26
Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will make steps towards resolving several issues we have been seeing.

@Roasbeef Roasbeef merged commit 9f358db into lightningnetwork:master May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants