From: Matt Corallo Date: Wed, 5 Sep 2018 00:10:32 +0000 (-0400) Subject: Ensure Channel::new_from_req always returns an ErrorMessage on Err X-Git-Tag: v0.0.12~329^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=f60b5d971c3b89af9671c8fbaee61c55fdc79a0c;p=rust-lightning Ensure Channel::new_from_req always returns an ErrorMessage on Err --- diff --git a/src/ln/channel.rs b/src/ln/channel.rs index 8dcd23b78..e9ba79f0b 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -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);