fn scan(block: &Block, data: &mut UserData) {
    for transaction in &block.transactions {
        transaction.update_trees(&mut data.blockchain).unwrap();
        transaction.update_witnesses(data).unwrap();
        transaction.scan(data);
        //remove unnecessary ceiling memory cells (and corresponding witnesses)
        let t_cur = u8_array_to_u64(&TransactionTime::current().0);
        for (i, ceil_memory) in data.ceil_memories.iter().enumerate() {
            if u8_array_to_u64(&ceil_memory.t_mem.0) > t_cur - TIME_LIMIT {
                data.ceil_memories.drain(0..(i - 1));
                data.ceil_memory_witnesses.drain(0..(i - 1));
                break;
            }
        }
    }
}
/// Scan a newly received block on transactions for this user. Updates `data` accordingly.
Scan a newly received block on transactions for this user. Updates `data` accordingly.
Scan a newly received block on transactions for this user . Updates ` data ` accordingly .
fn scan(block: &Block, data: &mut UserData) {
    for transaction in &block.transactions {
        transaction.update_trees(&mut data.blockchain).unwrap();
        transaction.update_witnesses(data).unwrap();
        transaction.scan(data);
        //remove unnecessary ceiling memory cells (and corresponding witnesses)
        let t_cur = u8_array_to_u64(&TransactionTime::current().0);
        for (i, ceil_memory) in data.ceil_memories.iter().enumerate() {
            if u8_array_to_u64(&ceil_memory.t_mem.0) > t_cur - TIME_LIMIT {
                data.ceil_memories.drain(0..(i - 1));
                data.ceil_memory_witnesses.drain(0..(i - 1));
                break;
            }
        }
    }
}
fn scan ( block : & Block , data : & mut UserData ) { for transaction in & block . transactions { transaction . update_trees ( & mut data . blockchain ) . unwrap ( ) ; transaction . update_witnesses ( data ) . unwrap ( ) ; transaction . scan ( data ) ; //remove unnecessary ceiling memory cells (and corresponding witnesses) let t_cur = u8_array_to_u64 ( & TransactionTime :: current ( ) . 0 ) ; for ( i , ceil_memory ) in data . ceil_memories . iter ( ) . enumerate ( ) { if u8_array_to_u64 ( & ceil_memory . t_mem . 0 ) > t_cur - TIME_LIMIT { data . ceil_memories . drain ( 0 .. ( i - 1 ) ) ; data . ceil_memory_witnesses . drain ( 0 .. ( i - 1 ) ) ; break ; } } } }
Scan a newly received block on transactions for this user.
Scan a newly received block on transactions for this user .
block
&Block
data
&mut UserData
block
&Block
data
&mut UserData