Use ChainHash instead of BlockHash as applicable
[rust-lightning] / lightning-rapid-gossip-sync / src / processing.rs
index fca318a5fa5f8cfac735ff8d3880819e8b6d93a0..d54f1329798b0b986363f67f4c86b91c59f0d929 100644 (file)
@@ -2,7 +2,7 @@ use core::cmp::max;
 use core::ops::Deref;
 use core::sync::atomic::Ordering;
 
-use bitcoin::BlockHash;
+use bitcoin::blockdata::constants::ChainHash;
 use bitcoin::secp256k1::PublicKey;
 
 use lightning::ln::msgs::{
@@ -67,9 +67,9 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
                        return Err(DecodeError::UnknownVersion.into());
                }
 
-               let chain_hash: BlockHash = Readable::read(read_cursor)?;
-               let ng_genesis_hash = self.network_graph.get_genesis_hash();
-               if chain_hash != ng_genesis_hash {
+               let chain_hash: ChainHash = Readable::read(read_cursor)?;
+               let ng_chain_hash = self.network_graph.get_chain_hash();
+               if chain_hash != ng_chain_hash {
                        return Err(
                                LightningError {
                                        err: "Rapid Gossip Sync data's chain hash does not match the network graph's".to_owned(),