Skip to main content

transaction_data_from_parts

Function transaction_data_from_parts 

Source
pub(crate) fn transaction_data_from_parts(
    version: TxVersion,
    branch_id: BranchId,
    lock_time: u32,
    expiry_height: BlockHeight,
    transparent_bundle: Option<Bundle<Authorized>>,
    sprout_bundle: Option<Bundle>,
    sapling_bundle: Option<Bundle<Authorized, ZatBalance>>,
    orchard_bundle: Option<Bundle<Authorized, ZatBalance>>,
    ironwood_bundle: Option<Bundle<Authorized, ZatBalance>>,
) -> TransactionData<Authorized>
Expand description

Builds TransactionData from its parts, routing v6 transactions through TransactionData::from_parts_v6.

Use this instead of TransactionData::from_parts whenever an existing transaction is being rebuilt. from_parts hard-codes ironwood_bundle: None, so rebuilding a v6 transaction through it silently drops the Ironwood bundle. That changes the transaction ID, and if the result reaches the verifier it also skips the Ironwood proof check, because the verifier only queues that check when the bundle is present.

Taking ironwood_bundle as a required argument is the point: the compiler will not let a caller forget to carry it across. This is the only place the version dispatch is made.