Skip to content

Commit c09669f

Browse files
author
Antoine Riard
committed
Fill in error actions in internal_accept_channel
1 parent 6a704ea commit c09669f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ln/channelmanager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,12 +1445,14 @@ impl ChannelManager {
14451445
match channel_state.by_id.get_mut(&msg.temporary_channel_id) {
14461446
Some(chan) => {
14471447
if chan.get_their_node_id() != *their_node_id {
1448-
return Err(HandleError{err: "Got a message for a channel from the wrong node!", action: None});
1448+
//TODO: see issue #153, need a consistent behavior on obnoxious behavior from random node
1449+
return Err(MsgHandleErrInternal::send_err_msg_no_close("Got a message for a channel from the wrong node!", msg.temporary_channel_id));
14491450
}
14501451
chan.accept_channel(&msg).map_err(|e| MsgHandleErrInternal::from_maybe_close(e))?;
14511452
(chan.get_value_satoshis(), chan.get_funding_redeemscript().to_v0_p2wsh(), chan.get_user_id())
14521453
},
1453-
None => return Err(HandleError{err: "Failed to find corresponding channel", action: None})
1454+
//TODO: same as above
1455+
None => return Err(MsgHandleErrInternal::send_err_msg_no_close("Failed to find corresponding channel", msg.temporary_channel_id))
14541456
}
14551457
};
14561458
let mut pending_events = self.pending_events.lock().unwrap();

0 commit comments

Comments
 (0)