Update to latest upstream rust-bitcoin
[rust-lightning] / lightning / src / ln / channelmanager.rs
index 6116a49eee6088cc716cd8c60551ad463700bb79..ee99012c5846922d7265f2d7336d9d7fec129ed3 100644 (file)
@@ -21,7 +21,6 @@ use bitcoin::blockdata::block::BlockHeader;
 use bitcoin::blockdata::transaction::Transaction;
 use bitcoin::blockdata::constants::genesis_block;
 use bitcoin::network::constants::Network;
-use bitcoin::util::hash::BitcoinHash;
 
 use bitcoin::hashes::{Hash, HashEngine};
 use bitcoin::hashes::hmac::{Hmac, HmacEngine};
@@ -724,7 +723,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
 
                ChannelManager {
                        default_configuration: config.clone(),
-                       genesis_hash: genesis_block(network).header.bitcoin_hash(),
+                       genesis_hash: genesis_block(network).header.block_hash(),
                        fee_estimator: fee_est,
                        monitor,
                        tx_broadcaster,
@@ -3060,7 +3059,7 @@ impl<ChanSigner: ChannelKeys, M: Deref + Sync + Send, T: Deref + Sync + Send, K:
                                L::Target: Logger,
 {
        fn block_connected(&self, header: &BlockHeader, height: u32, txn_matched: &[&Transaction], indexes_of_txn_matched: &[usize]) {
-               let header_hash = header.bitcoin_hash();
+               let header_hash = header.block_hash();
                log_trace!(self.logger, "Block {} at height {} connected with {} txn matched", header_hash, height, txn_matched.len());
                let _ = self.total_consistency_lock.read().unwrap();
                let mut failed_channels = Vec::new();
@@ -3200,7 +3199,7 @@ impl<ChanSigner: ChannelKeys, M: Deref + Sync + Send, T: Deref + Sync + Send, K:
                        self.finish_force_close_channel(failure);
                }
                self.latest_block_height.fetch_sub(1, Ordering::AcqRel);
-               *self.last_block_hash.try_lock().expect("block_(dis)connected must not be called in parallel") = header.bitcoin_hash();
+               *self.last_block_hash.try_lock().expect("block_(dis)connected must not be called in parallel") = header.block_hash();
        }
 }