+/// Returns the script for the counterparty's output on a holder's commitment transaction based on
+/// the channel type.
+pub fn get_counterparty_payment_script(channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey) -> Script {
+ if channel_type_features.supports_anchors_zero_fee_htlc_tx() {
+ get_to_countersignatory_with_anchors_redeemscript(payment_key).to_v0_p2wsh()
+ } else {
+ Script::new_v0_p2wpkh(&WPubkeyHash::hash(&payment_key.serialize()))
+ }
+}
+