pub fn consensus_branch_id(
tx: &Transaction,
height: Height,
network: &Network,
) -> Result<(), TransactionError>
Expand description
Checks the nConsensusBranchId
field.
§Consensus
§7.1.2 Transaction Consensus Rules
[NU5 onward] If
effectiveVersion
≥ 5, thenConsensusBranchId
field MUST match the consensus branch ID used for SIGHASH transaction hashes, as specified in ZIP-244.
§Notes
-
When deserializing transactions, Zebra converts the
nConsensusBranchId
intoNetworkUpgrade
. -
The values returned by
Transaction::version
matcheffectiveVersion
so we use them in place ofeffectiveVersion
. More details inTransaction::version
.