Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/bin/hal/cmd/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,11 @@ fn cmd_rawsign<'a>() -> clap::App<'a, 'a> {
args::arg("psbt", "PSBT to finalize, either base64/hex or a file path").required(false),
args::arg("input-idx", "the input index to edit").required(true),
args::arg("priv-key", "the private key in WIF/hex").required(true),
args::flag("compressed", "Whether the corresponding pk is compressed")
.required(false)
.default_value("true"),
args::flag("raw-stdout", "output the raw bytes of the result to stdout")
.short("r"),
args::opt("output", "where to save the resulting PSBT file -- in place if omitted")
.short("o"),
args::opt("uncompressed", "Whether the corresponding pubkey should be used uncompressed"),
])
}

Expand All @@ -436,8 +434,7 @@ fn exec_rawsign<'a>(args: &clap::ArgMatches<'a>) {
let sk = args.need_privkey("priv-key").inner;
let i = args.value_of("input-idx").need("Input index not provided")
.parse::<usize>().need("input-idx must be a positive integer");
let compressed = args.value_of("compressed").unwrap()
.parse::<bool>().need("Compressed must be boolean");
let uncompressed = args.is_present("uncompressed");

if i >= psbt.inputs.len() {
panic!("PSBT input index out of range")
Expand All @@ -448,7 +445,7 @@ fn exec_rawsign<'a>(args: &clap::ArgMatches<'a>) {

let pk = secp256k1::PublicKey::from_secret_key(&SECP, &sk);
let pk = bitcoin::PublicKey {
compressed: compressed,
compressed: !uncompressed,
inner: pk,
};
let msg = psbt.sighash_msg(i, &mut cache, None)
Expand Down