diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index dd448fd8..5f995a26 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -427,6 +427,25 @@ impl Script { Script::new_p2sh(&self.script_hash()) } + /// Returns the script code used for spending a P2WPKH output if this script is a script pubkey + /// for a P2WPKH output. The `scriptCode` is described in [BIP143]. + /// + /// [BIP143]: + pub fn p2wpkh_script_code(&self) -> Option