zebra_state::service::check::anchors

Function block_sprout_anchors_refer_to_treestates

source
pub(crate) fn block_sprout_anchors_refer_to_treestates(
    sprout_final_treestates: HashMap<Root, Arc<NoteCommitmentTree>>,
    block: Arc<Block>,
    transaction_hashes: Arc<[Hash]>,
    height: Height,
) -> Result<(), ValidateContextError>
Expand description

Accepts a ZebraDb, Arc<Chain>, Arc<Block>, and an Arc<[transaction::Hash]> of hashes corresponding to the transactions in Block

Iterates over the transactions in the Block checking the final Sprout anchors.

Sprout anchors may refer to some earlier block’s final treestate (like Sapling and Orchard do exclusively) or to the interstitial output treestate of any prior JoinSplit within the same transaction.

This method searches for anchors in the supplied sprout_final_treestates (which must be populated with all treestates pointed to in the semantically_verified block; see fetch_sprout_final_treestates()); or in the interstitial treestates which are computed on the fly in this function.