]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Ensure Channel::new_from_req always returns an ErrorMessage on Err
authorMatt Corallo <git@bluematt.me>
Wed, 5 Sep 2018 00:10:32 +0000 (20:10 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 5 Sep 2018 00:27:58 +0000 (20:27 -0400)
src/ln/channel.rs

index 8dcd23b785ec811e6ccda83078bd1165506bc35d..e9ba79f0b4d4e39fd3f3e10799ae1b9eda5c4a9f 100644 (file)
@@ -525,10 +525,10 @@ impl Channel {
 
                let their_announce = if (msg.channel_flags & 1) == 1 { true } else { false };
                if require_announce && !their_announce {
-                       return Err(HandleError{err: "Peer tried to open unannounced channel, but we require public ones", action: Some(msgs::ErrorAction::IgnoreError) });
+                       return_error_message!("Peer tried to open unannounced channel, but we require public ones");
                }
                if !allow_announce && their_announce {
-                       return Err(HandleError{err: "Peer tried to open announced channel, but we require private ones", action: Some(msgs::ErrorAction::IgnoreError) });
+                       return_error_message!("Peer tried to open announced channel, but we require private ones");
                }
 
                let background_feerate = fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::Background);