projects
/
ldk-sample
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
147435b
)
Avoid panic if chan IDs passed to {force,}closechannel isn't 32 bytes
author
Matt Corallo
<git@bluematt.me>
Sun, 27 Mar 2022 03:32:43 +0000
(
03:32
+0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 28 Mar 2022 21:31:08 +0000
(21:31 +0000)
src/cli.rs
patch
|
blob
|
history
diff --git
a/src/cli.rs
b/src/cli.rs
index 88f854265356274754a7ac7d396f1ee7ec4d7790..3d28fd113f2c5eb9c432b20dcd1b5f88598c24ad 100644
(file)
--- a/
src/cli.rs
+++ b/
src/cli.rs
@@
-320,8
+320,8
@@
pub(crate) async fn poll_for_user_input<E: EventHandler>(
continue;
}
let channel_id_vec = hex_utils::to_vec(channel_id_str.unwrap());
continue;
}
let channel_id_vec = hex_utils::to_vec(channel_id_str.unwrap());
- if channel_id_vec.is_none() {
- println!("ERROR: couldn't parse channel_id
as hex
");
+ if channel_id_vec.is_none()
|| channel_id_vec.as_ref().unwrap().len() != 32
{
+ println!("ERROR: couldn't parse channel_id");
continue;
}
let mut channel_id = [0; 32];
continue;
}
let mut channel_id = [0; 32];
@@
-335,8
+335,8
@@
pub(crate) async fn poll_for_user_input<E: EventHandler>(
continue;
}
let channel_id_vec = hex_utils::to_vec(channel_id_str.unwrap());
continue;
}
let channel_id_vec = hex_utils::to_vec(channel_id_str.unwrap());
- if channel_id_vec.is_none() {
- println!("ERROR: couldn't parse channel_id
as hex
");
+ if channel_id_vec.is_none()
|| channel_id_vec.as_ref().unwrap().len() != 32
{
+ println!("ERROR: couldn't parse channel_id");
continue;
}
let mut channel_id = [0; 32];
continue;
}
let mut channel_id = [0; 32];