Merge pull request #116 from wpaulino/anchors
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Mon, 14 Aug 2023 18:47:11 +0000 (18:47 +0000)
committerGitHub <noreply@github.com>
Mon, 14 Aug 2023 18:47:11 +0000 (18:47 +0000)
Add support for opening anchor outputs channels

src/cli.rs

index dab8bac9860b203a4c777637069babda8b44e581..10dce9283657345c110cbb47d1e4b85a576e5627 100644 (file)
@@ -373,14 +373,14 @@ pub(crate) async fn poll_for_user_input(
                                "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()
                                                )
                                        );