X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fscript.rs;h=218b482769aeee3859fbd2422fc19a0e29010629;hb=28d33ff9e03b7e3a0cd7ba3bc59f1303b3903f88;hp=0c060e4523374b71f569c5a4338d617177dfe6ba;hpb=1a743672b92a65e3d401a11001354f3b514bf956;p=rust-lightning diff --git a/lightning/src/ln/script.rs b/lightning/src/ln/script.rs index 0c060e45..218b4827 100644 --- a/lightning/src/ln/script.rs +++ b/lightning/src/ln/script.rs @@ -4,7 +4,7 @@ use bitcoin::blockdata::opcodes::all::OP_PUSHBYTES_0 as SEGWIT_V0; use bitcoin::blockdata::script::{Builder, Script}; use bitcoin::hashes::Hash; use bitcoin::hash_types::{WPubkeyHash, WScriptHash}; -use bitcoin::secp256k1::key::PublicKey; +use bitcoin::secp256k1::PublicKey; use ln::features::InitFeatures; use ln::msgs::DecodeError; @@ -21,7 +21,7 @@ use io; pub struct ShutdownScript(ShutdownScriptImpl); /// An error occurring when converting from [`Script`] to [`ShutdownScript`]. -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct InvalidShutdownScript { /// The script that did not meet the requirements from [BOLT #2]. /// @@ -68,12 +68,12 @@ impl ShutdownScript { /// Generates a P2WPKH script pubkey from the given [`WPubkeyHash`]. pub fn new_p2wpkh(pubkey_hash: &WPubkeyHash) -> Self { - Self(ShutdownScriptImpl::Bolt2(Script::new_v0_wpkh(pubkey_hash))) + Self(ShutdownScriptImpl::Bolt2(Script::new_v0_p2wpkh(pubkey_hash))) } /// Generates a P2WSH script pubkey from the given [`WScriptHash`]. pub fn new_p2wsh(script_hash: &WScriptHash) -> Self { - Self(ShutdownScriptImpl::Bolt2(Script::new_v0_wsh(script_hash))) + Self(ShutdownScriptImpl::Bolt2(Script::new_v0_p2wsh(script_hash))) } /// Generates a witness script pubkey from the given segwit version and program. @@ -156,7 +156,7 @@ impl Into