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

feat: Recover from pending offer #1822

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Conversation

holzeis
Copy link
Contributor

@holzeis holzeis commented Jan 16, 2024

Checks on on_connect if the current dlc channel status is in offered.

  • OfferedChannel: Automatically tries to accept the offer, if that fails the offer is attempted to be rejected. I think we do not need to check the maturity date outside of accepting the offer as the offer will fail anyways if the maturity date is in the past. If so we are continuing with rejecting the dlc channel offer.
  • SignedChannel(state: SettledReceived): Automatically accept the offer to close the position (settle the dlc channel)
  • SignedChannel(state: CollaborativeCloseOffered): Automatically accept the offer to collab close the dlc channel.

Future work

@holzeis holzeis requested review from bonomat and luckysori January 16, 2024 14:08
@holzeis holzeis self-assigned this Jan 16, 2024
@holzeis holzeis marked this pull request as draft January 16, 2024 14:08
@holzeis holzeis marked this pull request as ready for review January 16, 2024 14:08
@holzeis holzeis changed the title chore: Add reject dlc channel offer feat: Recover from pending offer Jan 16, 2024
Base automatically changed from feat/dlc-channel-recovery-on-restart to main January 16, 2024 14:32
@holzeis holzeis force-pushed the feat/recover-from-pending-offer branch from 2c03f3c to fd09ce3 Compare January 16, 2024 15:05
Copy link
Contributor

@bonomat bonomat left a comment

Choose a reason for hiding this comment

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

Very nice.

If something fails in the post processing the message should still be marked as processed.

Note, that wouldn't be required if we'd use a proper database transaction for the whole function.
@holzeis holzeis force-pushed the feat/recover-from-pending-offer branch from 29bbc42 to 6dd74e5 Compare January 16, 2024 21:12
@holzeis holzeis enabled auto-merge January 16, 2024 21:12
@holzeis holzeis linked an issue Jan 16, 2024 that may be closed by this pull request
@holzeis holzeis added this pull request to the merge queue Jan 16, 2024
Merged via the queue into main with commit a10af11 Jan 16, 2024
9 checks passed
@holzeis holzeis deleted the feat/recover-from-pending-offer branch January 16, 2024 21:27
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.

DLC-channel protocol recovery on restart
2 participants