@@ -3012,7 +3012,7 @@ macro_rules! locked_close_channel {
3012
3012
}
3013
3013
3014
3014
/// Returns (boolean indicating if we should remove the Channel object from memory, a mapped error)
3015
- macro_rules! convert_chan_phase_err {
3015
+ macro_rules! convert_channel_err {
3016
3016
($self: ident, $peer_state: expr, $err: expr, $context: expr, $channel_id: expr, MANUAL_CHANNEL_UPDATE, $channel_update: expr) => {
3017
3017
match $err {
3018
3018
ChannelError::Warn(msg) => {
@@ -3032,19 +3032,19 @@ macro_rules! convert_chan_phase_err {
3032
3032
},
3033
3033
}
3034
3034
};
3035
- ($self: ident, $peer_state: expr, $err: expr, $channel : expr, $channel_id: expr, FUNDED_CHANNEL) => {
3036
- convert_chan_phase_err !($self, $peer_state, $err, $channel .context, $channel_id, MANUAL_CHANNEL_UPDATE, { $self.get_channel_update_for_broadcast(&$channel ).ok() })
3035
+ ($self: ident, $peer_state: expr, $err: expr, $funded_channel : expr, $channel_id: expr, FUNDED_CHANNEL) => {
3036
+ convert_channel_err !($self, $peer_state, $err, $funded_channel .context, $channel_id, MANUAL_CHANNEL_UPDATE, { $self.get_channel_update_for_broadcast(&$funded_channel ).ok() })
3037
3037
};
3038
3038
($self: ident, $peer_state: expr, $err: expr, $context: expr, $channel_id: expr, UNFUNDED_CHANNEL) => {
3039
- convert_chan_phase_err !($self, $peer_state, $err, $context, $channel_id, MANUAL_CHANNEL_UPDATE, None)
3039
+ convert_channel_err !($self, $peer_state, $err, $context, $channel_id, MANUAL_CHANNEL_UPDATE, None)
3040
3040
};
3041
- ($self: ident, $peer_state: expr, $err: expr, $channel_phase : expr, $channel_id: expr) => {
3042
- match $channel_phase .as_funded_mut() {
3043
- Some(channel ) => {
3044
- convert_chan_phase_err !($self, $peer_state, $err, channel , $channel_id, FUNDED_CHANNEL)
3041
+ ($self: ident, $peer_state: expr, $err: expr, $channel : expr, $channel_id: expr) => {
3042
+ match $channel .as_funded_mut() {
3043
+ Some(funded_channel ) => {
3044
+ convert_channel_err !($self, $peer_state, $err, funded_channel , $channel_id, FUNDED_CHANNEL)
3045
3045
},
3046
3046
None => {
3047
- convert_chan_phase_err !($self, $peer_state, $err, $channel_phase .context_mut(), $channel_id, UNFUNDED_CHANNEL)
3047
+ convert_channel_err !($self, $peer_state, $err, $channel .context_mut(), $channel_id, UNFUNDED_CHANNEL)
3048
3048
},
3049
3049
}
3050
3050
};
@@ -3056,7 +3056,7 @@ macro_rules! break_chan_phase_entry {
3056
3056
Ok(res) => res,
3057
3057
Err(e) => {
3058
3058
let key = *$entry.key();
3059
- let (drop, res) = convert_chan_phase_err !($self, $peer_state, e, $entry.get_mut(), &key);
3059
+ let (drop, res) = convert_channel_err !($self, $peer_state, e, $entry.get_mut(), &key);
3060
3060
if drop {
3061
3061
$entry.remove_entry();
3062
3062
}
@@ -3072,7 +3072,7 @@ macro_rules! try_chan_phase_entry {
3072
3072
Ok(res) => res,
3073
3073
Err(e) => {
3074
3074
let key = *$entry.key();
3075
- let (drop, res) = convert_chan_phase_err !($self, $peer_state, e, $entry.get_mut(), &key);
3075
+ let (drop, res) = convert_channel_err !($self, $peer_state, e, $entry.get_mut(), &key);
3076
3076
if drop {
3077
3077
$entry.remove_entry();
3078
3078
}
@@ -6436,7 +6436,7 @@ where
6436
6436
if chan_needs_persist == NotifyOption::DoPersist { should_persist = NotifyOption::DoPersist; }
6437
6437
6438
6438
if let Err(e) = chan.timer_check_closing_negotiation_progress() {
6439
- let (needs_close, err) = convert_chan_phase_err !(self, peer_state, e, chan, chan_id, FUNDED_CHANNEL);
6439
+ let (needs_close, err) = convert_channel_err !(self, peer_state, e, chan, chan_id, FUNDED_CHANNEL);
6440
6440
handle_errors.push((Err(err), counterparty_node_id));
6441
6441
if needs_close { return false; }
6442
6442
}
@@ -8064,14 +8064,14 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8064
8064
// Really we should be returning the channel_id the peer expects based
8065
8065
// on their funding info here, but they're horribly confused anyway, so
8066
8066
// there's not a lot we can do to save them.
8067
- return Err(convert_chan_phase_err !(self, peer_state, err, inbound_chan.context, &msg.temporary_channel_id, UNFUNDED_CHANNEL).1);
8067
+ return Err(convert_channel_err !(self, peer_state, err, inbound_chan.context, &msg.temporary_channel_id, UNFUNDED_CHANNEL).1);
8068
8068
},
8069
8069
}
8070
8070
},
8071
8071
Some(Err(mut phase)) => {
8072
8072
let err_msg = format!("Got an unexpected funding_created message from peer with counterparty_node_id {}", counterparty_node_id);
8073
8073
let err = ChannelError::close(err_msg);
8074
- return Err(convert_chan_phase_err !(self, peer_state, err, &mut phase, &msg.temporary_channel_id).1);
8074
+ return Err(convert_channel_err !(self, peer_state, err, &mut phase, &msg.temporary_channel_id).1);
8075
8075
},
8076
8076
None => return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}", counterparty_node_id), msg.temporary_channel_id))
8077
8077
};
@@ -8081,12 +8081,12 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8081
8081
macro_rules! fail_chan { ($err: expr) => { {
8082
8082
// Note that at this point we've filled in the funding outpoint on our
8083
8083
// channel, but its actually in conflict with another channel. Thus, if
8084
- // we call `convert_chan_phase_err ` immediately (thus calling
8084
+ // we call `convert_channel_err ` immediately (thus calling
8085
8085
// `locked_close_channel`), we'll remove the existing channel from `outpoint_to_peer`.
8086
8086
// Thus, we must first unset the funding outpoint on the channel.
8087
8087
let err = ChannelError::close($err.to_owned());
8088
8088
chan.unset_funding_info(msg.temporary_channel_id);
8089
- return Err(convert_chan_phase_err !(self, peer_state, err, chan.context, &funded_channel_id, UNFUNDED_CHANNEL).1);
8089
+ return Err(convert_channel_err !(self, peer_state, err, chan.context, &funded_channel_id, UNFUNDED_CHANNEL).1);
8090
8090
} } }
8091
8091
8092
8092
match peer_state.channel_by_id.entry(funded_channel_id) {
@@ -8175,7 +8175,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8175
8175
// found an (unreachable) panic when the monitor update contained
8176
8176
// within `shutdown_finish` was applied.
8177
8177
chan.unset_funding_info(msg.channel_id);
8178
- return Err(convert_chan_phase_err !(self, peer_state, e, chan, &msg.channel_id, FUNDED_CHANNEL).1);
8178
+ return Err(convert_channel_err !(self, peer_state, e, chan, &msg.channel_id, FUNDED_CHANNEL).1);
8179
8179
}
8180
8180
},
8181
8181
Err((mut chan, e)) => {
@@ -8184,7 +8184,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8184
8184
// We've already removed this outbound channel from the map in
8185
8185
// `PeerState` above so at this point we just need to clean up any
8186
8186
// lingering entries concerning this channel as it is safe to do so.
8187
- return Err(convert_chan_phase_err !(self, peer_state, e, chan.context, &msg.channel_id, UNFUNDED_CHANNEL).1);
8187
+ return Err(convert_channel_err !(self, peer_state, e, chan.context, &msg.channel_id, UNFUNDED_CHANNEL).1);
8188
8188
}
8189
8189
}
8190
8190
} else {
@@ -9560,7 +9560,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9560
9560
},
9561
9561
Err(e) => {
9562
9562
has_update = true;
9563
- let (close_channel, res) = convert_chan_phase_err !(self, peer_state, e, chan, channel_id, FUNDED_CHANNEL);
9563
+ let (close_channel, res) = convert_channel_err !(self, peer_state, e, chan, channel_id, FUNDED_CHANNEL);
9564
9564
handle_errors.push((chan.context.get_counterparty_node_id(), Err(res)));
9565
9565
!close_channel
9566
9566
}
0 commit comments