Skip to content

Commit 0df5629

Browse files
committed
Clearer error message when there is no channel waiting to be accepted.
1 parent 1e1d1a7 commit 0df5629

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5201,7 +5201,7 @@ where
52015201
&unaccepted_channel.open_channel_msg, user_channel_id, &self.default_configuration, best_block_height,
52025202
&self.logger, unaccepted_channel.outbound_scid_alias).map_err(|e| APIError::ChannelUnavailable { err: e.to_string() })
52035203
}
5204-
_ => Err(APIError::APIMisuseError { err: "The channel isn't currently awaiting to be accepted.".to_owned() })
5204+
_ => Err(APIError::APIMisuseError { err: "No such channel awaiting to be accepted.".to_owned() })
52055205
}?;
52065206

52075207
if accept_0conf {

lightning/src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7964,7 +7964,7 @@ fn test_can_not_accept_inbound_channel_twice() {
79647964
let api_res = nodes[1].node.accept_inbound_channel(&temporary_channel_id, &nodes[0].node.get_our_node_id(), 0);
79657965
match api_res {
79667966
Err(APIError::APIMisuseError { err }) => {
7967-
assert_eq!(err, "The channel isn't currently awaiting to be accepted.");
7967+
assert_eq!(err, "No such channel awaiting to be accepted.");
79687968
},
79697969
Ok(_) => panic!("Channel shouldn't be possible to be accepted twice"),
79707970
Err(e) => panic!("Unexpected Error {:?}", e),
@@ -7996,7 +7996,7 @@ fn test_can_not_accept_unknown_inbound_channel() {
79967996
let api_res = nodes[0].node.accept_inbound_channel(&unknown_channel_id, &nodes[1].node.get_our_node_id(), 0);
79977997
match api_res {
79987998
Err(APIError::APIMisuseError { err }) => {
7999-
assert_eq!(err, "The channel isn't currently awaiting to be accepted.");
7999+
assert_eq!(err, "No such channel awaiting to be accepted.");
80008000
},
80018001
Ok(_) => panic!("It shouldn't be possible to accept an unkown channel"),
80028002
Err(e) => panic!("Unexpected Error: {:?}", e),

0 commit comments

Comments
 (0)