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

Avoid cascading failure: give up on incoming HTLCs in time if outgoing is stuck. #6378

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions onchaind/onchaind.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,12 +1499,16 @@ static void handle_preimage(struct tracked_output **outs,
if (!ripemd160_eq(&outs[i]->htlc.ripemd, &ripemd))
continue;

/* Too late? */
/* If HTLC has timed out, we will already have
* proposed a "ignore this, it's their problem". But
* now try this proposal instead! */
if (outs[i]->resolved) {
status_broken("HTLC already resolved by %s"
" when we found preimage",
tx_type_name(outs[i]->resolved->tx_type));
return;
if (outs[i]->resolved->tx_type != SELF) {
status_broken("HTLC already resolved by %s"
" when we found preimage",
tx_type_name(outs[i]->resolved->tx_type));
return;
}
Comment on lines +1506 to +1511
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can remove the {..} due the single stmt inside the if?

}

/* stash the payment_hash so we can track this coin movement */
Expand Down