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

return counterparty pk when rejecting subchannel offer and handle rejected state #182

Conversation

bonomat
Copy link
Collaborator

@bonomat bonomat commented Dec 4, 2023

Useful because we will need to send the reject message afterwards and for that we need to know to whom.

Useful because we will need to send the reject message afterwards and for that we need the key.
@bonomat bonomat changed the title chore: return counterparty pk when rejecting subchannel offer return counterparty pk when rejecting subchannel offer and handle rejected state Dec 4, 2023
@bonomat bonomat requested a review from holzeis December 4, 2023 16:04
Copy link
Contributor

@Tibo-lg Tibo-lg left a comment

Choose a reason for hiding this comment

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

LGTM but I'd like at least one integration test to make sure the re-opening of a rejected channel is working as expected.

@bonomat bonomat force-pushed the chore/reject_sub_channel_close_offer-return-value branch from 81ac40c to e3c3602 Compare December 8, 2023 15:36
@bonomat
Copy link
Collaborator Author

bonomat commented Dec 8, 2023

LGTM but I'd like at least one integration test to make sure the re-opening of a rejected channel is working as expected.

I've added a test https://github.com/p2pderivatives/rust-dlc/compare/81ac40c551203a18be147feca7e4361d02ef2567..e3c3602bdd6d32fd00dbff2577671269ab61cb50

@bonomat bonomat requested a review from Tibo-lg December 8, 2023 15:41

reject_offer(&test_params);

offer_sub_channel_internal(&test_params, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you use open_sub_channel instead since it's there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done: 5f80d38

@bonomat
Copy link
Collaborator Author

bonomat commented Dec 11, 2023

I'll squash the last two commits before merged once approved

Copy link
Contributor

@Tibo-lg Tibo-lg left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

We need to treat the SubChannelState::Rejected same as `OffChainClosed` as otherwise we won't be able to open a new subchannel if an offer was rejected.
@bonomat bonomat force-pushed the chore/reject_sub_channel_close_offer-return-value branch from 5f80d38 to 994864a Compare December 12, 2023 05:46
@bonomat bonomat merged commit f235bd2 into feature/ln-dlc-channels-10101 Dec 12, 2023
194 checks passed
@bonomat bonomat deleted the chore/reject_sub_channel_close_offer-return-value branch December 12, 2023 09:38
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.

3 participants