[−][src]Function grin_core::core::transaction::cut_through
pub fn cut_through<'a, 'b, T, U>(
inputs: &'a mut [T],
outputs: &'b mut [U]
) -> Result<(&'a [T], &'b [U], &'a [T], &'b [U]), Error> where
T: AsRef<Commitment> + Ord,
U: AsRef<Commitment> + Ord,
Takes a slice of inputs and a slice of outputs and applies "cut-through"
eliminating any input/output pairs with input spending output.
Returns new slices with cut-through elements removed.
Also returns slices of the cut-through elements themselves.
Note: Takes slices of anything that is AsRef
Example: Inputs: [A, B, C] Outputs: [C, D, E] Returns: ([A, B], [D, E], [C], [C]) # element C is cut-through