From f60b5d971c3b89af9671c8fbaee61c55fdc79a0c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 4 Sep 2018 20:10:32 -0400 Subject: [PATCH] Ensure Channel::new_from_req always returns an ErrorMessage on Err --- src/ln/channel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5