From b6c3c67683cded4c70d41dfed5d05fbbe8aab0f7 Mon Sep 17 00:00:00 2001 From: jjy Date: Tue, 26 Mar 2024 22:27:53 +0800 Subject: [PATCH] fix: sign-txs multisig support full address --- src/subcommands/tx.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/subcommands/tx.rs b/src/subcommands/tx.rs index e827edf3..42f07a72 100644 --- a/src/subcommands/tx.rs +++ b/src/subcommands/tx.rs @@ -811,17 +811,9 @@ impl TryFrom for MultisigConfig { .sighash_addresses .into_iter() .map(|address_string| { - if let AddressPayload::Short { index, hash } = - Address::from_str(&address_string).map(|addr| addr.payload().clone())? - { - if index == CodeHashIndex::Sighash { - Ok(hash) - } else { - Err(format!("invalid address: {}", address_string)) - } - } else { - Err(format!("invalid address: {}", address_string)) - } + Address::from_str(&address_string) + .map(|addr| H160::from_slice(addr.payload().args().as_ref()))? + .map_err(|err| format!("invalid address: {address_string} error: {err:?}")) }) .collect::, String>>()?; MultisigConfig::new_with(sighash_addresses, repr.require_first_n, repr.threshold)