]> git.bitcoin.ninja Git - rust-lightning/commitdiff
fail channel when BADONION is not set.
authorYuntai Kyong <yuntai.kyong@gmail.com>
Mon, 5 Nov 2018 12:10:17 +0000 (21:10 +0900)
committerYuntai Kyong <yuntai.kyong@gmail.com>
Mon, 5 Nov 2018 12:10:17 +0000 (21:10 +0900)
src/ln/channelmanager.rs

index 1141d7dfbcd7c59be53fbfc3df6fdaa2f15fb67f..af2af9d809bd86a595a7a5c78c0b99fc29b724ab 100644 (file)
@@ -2194,8 +2194,8 @@ impl ChannelManager {
                                        //TODO: here and below MsgHandleErrInternal, #153 case
                                        return Err(MsgHandleErrInternal::send_err_msg_no_close("Got a message for a channel from the wrong node!", msg.channel_id));
                                }
-                               if (msg.failure_code & 0x8000) != 0 {
-                                       return Err(MsgHandleErrInternal::send_err_msg_close_chan("Got update_fail_malformed_htlc with BADONION set", msg.channel_id));
+                               if (msg.failure_code & 0x8000) == 0 {
+                                       return Err(MsgHandleErrInternal::send_err_msg_close_chan("Got update_fail_malformed_htlc with BADONION not set", msg.channel_id));
                                }
                                chan.update_fail_malformed_htlc(&msg, HTLCFailReason::Reason { failure_code: msg.failure_code, data: Vec::new() })
                                        .map_err(|e| MsgHandleErrInternal::from_chan_maybe_close(e, msg.channel_id))?;