Fixes https://github.com/lightningdevkit/rust-lightning/issues/2188
"listpeers" => list_peers(peer_manager.clone()),
"signmessage" => {
const MSG_STARTPOS: usize = "signmessage".len() + 1;
- if line.as_bytes().len() <= MSG_STARTPOS {
+ if line.trim().as_bytes().len() <= MSG_STARTPOS {
println!("ERROR: signmsg requires a message");
continue;
}
println!(
"{:?}",
lightning::util::message_signing::sign(
- &line.as_bytes()[MSG_STARTPOS..],
+ &line.trim().as_bytes()[MSG_STARTPOS..],
&keys_manager.get_node_secret_key()
)
);