Skip to content

Make my_current_per_commitment_point in ChannelReestablish optional #135

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

Merged
merged 3 commits into from
Aug 29, 2018

Conversation

yuntai
Copy link
Contributor

@yuntai yuntai commented Aug 29, 2018

No description provided.

yuntai added 2 commits August 29, 2018 12:55
Per Bolt lightningdevkit#2, both your_last_per_commitment_secret &
my_current_per_commitment_point are optional depending on
`data_loss_protect`
src/ln/msgs.rs Outdated

res.extend_from_slice(&serialize(&self.channel_id).unwrap()[..]);
res.extend_from_slice(&byte_utils::be64_to_array(self.next_local_commitment_number));
res.extend_from_slice(&byte_utils::be64_to_array(self.next_remote_commitment_number));

if let &Some(ref ary) = &self.your_last_per_commitment_secret {
res.extend_from_slice(&ary[..]);
res.extend_from_slice(&self.my_current_per_commitment_point.expect("my_current_per_commitment_point should have been filled").serialize());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, can we make it an Option<struct DataLossProtect { your_last..., my_current... }> isntead to avoid the unwrap here?

@TheBlueMatt
Copy link
Collaborator

Thanks for tackling this!

@yuntai
Copy link
Contributor Author

yuntai commented Aug 29, 2018

updated!

@TheBlueMatt TheBlueMatt merged commit bec2595 into lightningdevkit:master Aug 29, 2018
@yuntai yuntai deleted the 201808-channelreestablish branch August 30, 2018 15:37
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.

2 participants