pub fn check_transaction_network_upgrade_consistency(
        &self,
        network: Network,
    ) -> Result<(), error::BlockError> {
        let block_nu =
            NetworkUpgrade::current(network, self.coinbase_height().expect("a valid height"));

        if self
            .transactions
            .iter()
            .filter_map(|trans| trans.as_ref().network_upgrade())
            .any(|trans_nu| trans_nu != block_nu)
        {
            return Err(error::BlockError::WrongTransactionConsensusBranchId);
        }

        Ok(())
    }
/// Check if the `network_upgrade` fields from each transaction in the block matches
/// the network upgrade calculated from the `network` and block height.
///
/// # Consensus rule:
///
///  The nConsensusBranchId field MUST match the consensus branch ID used for
///  SIGHASH transaction hashes, as specified in [ZIP-244] ([7.1]).
///
/// [ZIP-244]: https://zips.z.cash/zip-0244
/// [7.1]: https://zips.z.cash/protocol/nu5.pdf#txnencodingandconsensus
Check if the `network_upgrade` fields from each transaction in the block matches
the network upgrade calculated from the `network` and block height.
Check if the ` network_upgrade ` fields from each transaction in the block matches the network upgrade calculated from the ` network ` and block height .
pub fn check_transaction_network_upgrade_consistency(
        &self,
        network: Network,
    ) -> Result<(), error::BlockError> {
        let block_nu =
            NetworkUpgrade::current(network, self.coinbase_height().expect("a valid height"));
        if self
            .transactions
            .iter()
            .filter_map(|trans| trans.as_ref().network_upgrade())
            .any(|trans_nu| trans_nu != block_nu)
        {
            return Err(error::BlockError::WrongTransactionConsensusBranchId);
        }
        Ok(())
    }
pub fn check_transaction_network_upgrade_consistency ( & self , network : Network , ) -> Result < ( ) , error :: BlockError > { let block_nu = NetworkUpgrade :: current ( network , self . coinbase_height ( ) . expect ( " " ) ) ; if self . transactions . iter ( ) . filter_map ( | trans | trans . as_ref ( ) . network_upgrade ( ) ) . any ( | trans_nu | trans_nu != block_nu ) { return Err ( error :: BlockError :: WrongTransactionConsensusBranchId ) ; } Ok ( ( ) ) }
Check if the `network_upgrade` fields from each transaction in the block matches
the network upgrade calculated from the `network` and block height.
Check if the ` network_upgrade ` fields from each transaction in the block matches the network upgrade calculated from the ` network ` and block height .
&self
network
Network
consensus rule:
The nConsensusBranchId field MUST match the consensus branch ID used for
SIGHASH transaction hashes, as specified in [ZIP-244] ([7.1]).


The nConsensusBranchId field MUST match the consensus branch ID used for SIGHASH transaction hashes as specified in [ ZIP - 244 ] ( [ 7 . 1 ] ) .