Skip to content

Commit 74f59a2

Browse files
authored
Merge pull request lightningdevkit#242 from yuntai/201811-malformed
Fail channel when BADONION is not set
2 parents 0e098d4 + 05b580e commit 74f59a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,8 +2194,8 @@ impl ChannelManager {
21942194
//TODO: here and below MsgHandleErrInternal, #153 case
21952195
return Err(MsgHandleErrInternal::send_err_msg_no_close("Got a message for a channel from the wrong node!", msg.channel_id));
21962196
}
2197-
if (msg.failure_code & 0x8000) != 0 {
2198-
return Err(MsgHandleErrInternal::send_err_msg_close_chan("Got update_fail_malformed_htlc with BADONION set", msg.channel_id));
2197+
if (msg.failure_code & 0x8000) == 0 {
2198+
return Err(MsgHandleErrInternal::send_err_msg_close_chan("Got update_fail_malformed_htlc with BADONION not set", msg.channel_id));
21992199
}
22002200
chan.update_fail_malformed_htlc(&msg, HTLCFailReason::Reason { failure_code: msg.failure_code, data: Vec::new() })
22012201
.map_err(|e| MsgHandleErrInternal::from_chan_maybe_close(e, msg.channel_id))?;

0 commit comments

Comments
 (0)