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