pub fn validate_vout(vout: &[u8]) -> bool {
    let n_outs = match parse_compact_int(vout) {
        Ok(v) => v,
        Err(_) => return false,
    };

    let vout_length = vout.len();

    let mut offset = n_outs.serialized_length();
    if n_outs == 0usize {
        return false;
    }

    for _ in 0..n_outs.as_usize() {
        if offset >= vout_length {
            return false;
        }
        match determine_output_length(&vout[offset as usize..]) {
            Ok(v) => offset += v as usize,
            Err(_) => return false,
        };
    }

    offset == vout_length
}
/// Checks that the vout passed up is properly formatted;
/// Consider a vin with a valid vout in its scriptsig.
///
/// # Arguments
///
/// * `vout` - Raw bytes length-prefixed output vector
Checks that the vout passed up is properly formatted;
Consider a vin with a valid vout in its scriptsig.
Checks that the vout passed up is properly formatted ; Consider a vin with a valid vout in its scriptsig .
pub fn validate_vout(vout: &[u8]) -> bool {
    let n_outs = match parse_compact_int(vout) {
        Ok(v) => v,
        Err(_) => return false,
    };
    let vout_length = vout.len();
    let mut offset = n_outs.serialized_length();
    if n_outs == 0usize {
        return false;
    }
    for _ in 0..n_outs.as_usize() {
        if offset >= vout_length {
            return false;
        }
        match determine_output_length(&vout[offset as usize..]) {
            Ok(v) => offset += v as usize,
            Err(_) => return false,
        };
    }
    offset == vout_length
}
pub fn validate_vout ( vout : & [ u8 ] ) -> bool { let n_outs = match parse_compact_int ( vout ) { Ok ( v ) => v , Err ( _ ) => return false , } ; let vout_length = vout . len ( ) ; let mut offset = n_outs . serialized_length ( ) ; if n_outs == 0usize { return false ; } for _ in 0 .. n_outs . as_usize ( ) { if offset >= vout_length { return false ; } match determine_output_length ( & vout [ offset as usize .. ] ) { Ok ( v ) => offset += v as usize , Err ( _ ) => return false , } ; } offset == vout_length }
Checks that the vout passed up is properly formatted;
Consider a vin with a valid vout in its scriptsig.
Checks that the vout passed up is properly formatted ; Consider a vin with a valid vout in its scriptsig .
vout
&[u8]
vout
&[u8]