diff --git a/bitcoin/src/blockdata/constants.rs b/bitcoin/src/blockdata/constants.rs index 01d8238c..7a737d38 100644 --- a/bitcoin/src/blockdata/constants.rs +++ b/bitcoin/src/blockdata/constants.rs @@ -185,6 +185,11 @@ impl ChainHash { let hashes = [Self::BITCOIN, Self::TESTNET, Self::SIGNET, Self::REGTEST]; hashes[network as usize] } + + /// Converts genesis block hash into `ChainHash`. + pub fn from_genesis_block_hash(block_hash: crate::BlockHash) -> Self { + ChainHash(block_hash.to_byte_array()) + } } #[cfg(test)]