Struct lightning::ln::script::ShutdownScript [−][src]
pub struct ShutdownScript(_);
Expand description
A script pubkey for shutting down a channel as defined by BOLT #2.
Implementations
Generates a P2PKH script pubkey from the given PubkeyHash
.
Generates a P2SH script pubkey from the given ScriptHash
.
Generates a P2WPKH script pubkey from the given WPubkeyHash
.
Generates a P2WSH script pubkey from the given WScriptHash
.
pub fn new_witness_program(
version: NonZeroU8,
program: &[u8]
) -> Result<Self, InvalidShutdownScript>
pub fn new_witness_program(
version: NonZeroU8,
program: &[u8]
) -> Result<Self, InvalidShutdownScript>
Generates a witness script pubkey from the given segwit version and program.
Note for version-zero witness scripts you must use ShutdownScript::new_p2wpkh
or
ShutdownScript::new_p2wsh
instead.
Errors
This function may return an error if program
is invalid for the segwit version
.
Converts the shutdown script into the underlying Script
.
Returns the PublicKey
used for a P2WPKH shutdown script if constructed directly from it.
Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
Specifically, checks for compliance with feature option_shutdown_anysegwit
.
Trait Implementations
type Error = InvalidShutdownScript
type Error = InvalidShutdownScript
The type returned in the event of a conversion error.
Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more
Writes self out to a Vec
Auto Trait Implementations
impl RefUnwindSafe for ShutdownScript
impl Send for ShutdownScript
impl Sync for ShutdownScript
impl Unpin for ShutdownScript
impl UnwindSafe for ShutdownScript
Blanket Implementations
Mutably borrows from an owned value. Read more