|
22 | 22 |
|
23 | 23 | use bitcoin::blockdata::block::BlockHeader; |
24 | 24 | use bitcoin::blockdata::transaction::{OutPoint as BitcoinOutPoint, TxOut, Transaction}; |
25 | | -use bitcoin::blockdata::script::{Script, Builder}; |
26 | | -use bitcoin::blockdata::opcodes; |
| 25 | +use bitcoin::blockdata::script::Script; |
27 | 26 |
|
28 | 27 | use bitcoin::hashes::Hash; |
29 | 28 | use bitcoin::hashes::sha256::Hash as Sha256; |
30 | | -use bitcoin::hash_types::{Txid, BlockHash, WPubkeyHash}; |
| 29 | +use bitcoin::hash_types::{Txid, BlockHash}; |
31 | 30 |
|
32 | 31 | use bitcoin::secp256k1::{Secp256k1, ecdsa::Signature}; |
33 | 32 | use bitcoin::secp256k1::{SecretKey, PublicKey}; |
@@ -1141,8 +1140,9 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> { |
1141 | 1140 | best_block: BestBlock, counterparty_node_id: PublicKey) -> ChannelMonitor<Signer> { |
1142 | 1141 |
|
1143 | 1142 | assert!(commitment_transaction_number_obscure_factor <= (1 << 48)); |
1144 | | - let payment_key_hash = WPubkeyHash::hash(&keys.pubkeys().payment_point.serialize()); |
1145 | | - let counterparty_payment_script = Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&payment_key_hash[..]).into_script(); |
| 1143 | + let counterparty_payment_script = chan_utils::get_counterparty_payment_script( |
| 1144 | + &channel_parameters.channel_type_features, &keys.pubkeys().payment_point |
| 1145 | + ); |
1146 | 1146 |
|
1147 | 1147 | let counterparty_channel_parameters = channel_parameters.counterparty_parameters.as_ref().unwrap(); |
1148 | 1148 | let counterparty_delayed_payment_base_key = counterparty_channel_parameters.pubkeys.delayed_payment_basepoint; |
@@ -2263,6 +2263,7 @@ macro_rules! fail_unbroadcast_htlcs { |
2263 | 2263 |
|
2264 | 2264 | #[cfg(test)] |
2265 | 2265 | pub fn deliberately_bogus_accepted_htlc_witness_program() -> Vec<u8> { |
| 2266 | + use bitcoin::blockdata::opcodes; |
2266 | 2267 | let mut ret = [opcodes::all::OP_NOP.to_u8(); 136]; |
2267 | 2268 | ret[131] = opcodes::all::OP_DROP.to_u8(); |
2268 | 2269 | ret[132] = opcodes::all::OP_DROP.to_u8(); |
|
0 commit comments