-
Notifications
You must be signed in to change notification settings - Fork 412
Channel cleanups #152
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
Channel cleanups #152
Changes from all commits
eeefdaf
8e4c062
d1568ca
3f5f3de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -447,6 +447,8 @@ impl ChannelManager { | |
//TODO: We need to handle monitoring of pending offered HTLCs which just hit the chain and | ||
//may be claimed, resulting in us claiming the inbound HTLCs (and back-failing after | ||
//timeouts are hit and our claims confirm). | ||
//TODO: In any case, we need to make sure we remove any pending htlc tracking (via | ||
//fail_backwards or claim_funds) eventually for all HTLCs that were in the channel | ||
} | ||
|
||
/// Force closes a channel, immediately broadcasting the latest local commitment transaction to | ||
|
@@ -1147,7 +1149,12 @@ impl ChannelManager { | |
if !add_htlc_msgs.is_empty() { | ||
let (commitment_msg, monitor) = match forward_chan.send_commitment() { | ||
Ok(res) => res, | ||
Err(_e) => { | ||
Err(e) => { | ||
if let &Some(msgs::ErrorAction::DisconnectPeer{msg: Some(ref _err_msg)}) = &e.action { | ||
} else if let &Some(msgs::ErrorAction::SendErrorMessage{msg: ref _err_msg}) = &e.action { | ||
} else { | ||
panic!("Stated return value requirements in send_commitment() were not met"); | ||
} | ||
//TODO: Handle...this is bad! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems all kind of errors are covered by the last else, so TODO can disappear? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heh, the ifs/panic is just to give the fuzz tester something to attack. The actually handling still has to happen. |
||
continue; | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more #153 case isn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I'm anticipating the fix for #153 is to just remove the distinction, have a general ChannelError type, then convert it to a HandleError in ChannelManager. That would simplify some of the Internal error awkwardness right now anyway.