fn process_ready_transactions(
        &mut self,
        address: &AccountAddress,
        current_sequence_number: u64,
    ) {
        if let Some(txns) = self.transactions.get_mut(&address) {
            let mut sequence_number = current_sequence_number;
            while let Some(txn) = txns.get_mut(&sequence_number) {
                self.priority_index.insert(txn);

                if txn.timeline_state == TimelineState::NotReady {
                    self.timeline_index.insert(txn);
                }
                sequence_number += 1;
            }

            let mut parking_lot_txns = 0;
            for (_, txn) in txns.range_mut((Bound::Excluded(sequence_number), Bound::Unbounded)) {
                match txn.timeline_state {
                    TimelineState::Ready(_) => {}
                    _ => {
                        self.parking_lot_index.insert(&txn);
                        parking_lot_txns += 1;
                    }
                }
            }
            trace!("[Mempool] txns for account {:?}. Current sequence_number: {}, length: {}, parking lot: {}",
                address, current_sequence_number, txns.len(), parking_lot_txns,
            );
        }
    }
/// fixes following invariants:
/// all transactions of given account that are sequential to current sequence number
/// supposed to be included in both PriorityIndex (ordering for Consensus) and
/// TimelineIndex (txns for SharedMempool)
/// Other txns are considered to be "non-ready" and should be added to ParkingLotIndex
fixes following invariants:
all transactions of given account that are sequential to current sequence number
supposed to be included in both PriorityIndex (ordering for Consensus) and
TimelineIndex (txns for SharedMempool)
Other txns are considered to be "non-ready" and should be added to ParkingLotIndex
fixes following invariants : all transactions of given account that are sequential to current sequence number supposed to be included in both PriorityIndex ( ordering for Consensus ) and TimelineIndex ( txns for SharedMempool ) Other txns are considered to be " non - ready " and should be added to ParkingLotIndex
fn process_ready_transactions(
        &mut self,
        address: &AccountAddress,
        current_sequence_number: u64,
    ) {
        if let Some(txns) = self.transactions.get_mut(&address) {
            let mut sequence_number = current_sequence_number;
            while let Some(txn) = txns.get_mut(&sequence_number) {
                self.priority_index.insert(txn);
                if txn.timeline_state == TimelineState::NotReady {
                    self.timeline_index.insert(txn);
                }
                sequence_number += 1;
            }
            let mut parking_lot_txns = 0;
            for (_, txn) in txns.range_mut((Bound::Excluded(sequence_number), Bound::Unbounded)) {
                match txn.timeline_state {
                    TimelineState::Ready(_) => {}
                    _ => {
                        self.parking_lot_index.insert(&txn);
                        parking_lot_txns += 1;
                    }
                }
            }
            trace!("[Mempool] txns for account {:?}. Current sequence_number: {}, length: {}, parking lot: {}",
                address, current_sequence_number, txns.len(), parking_lot_txns,
            );
        }
    }
fn process_ready_transactions ( & mut self , address : & AccountAddress , current_sequence_number : u64 , ) { if let Some ( txns ) = self . transactions . get_mut ( & address ) { let mut sequence_number = current_sequence_number ; while let Some ( txn ) = txns . get_mut ( & sequence_number ) { self . priority_index . insert ( txn ) ; if txn . timeline_state == TimelineState :: NotReady { self . timeline_index . insert ( txn ) ; } sequence_number += 1 ; } let mut parking_lot_txns = 0 ; for ( _ , txn ) in txns . range_mut ( ( Bound :: Excluded ( sequence_number ) , Bound :: Unbounded ) ) { match txn . timeline_state { TimelineState :: Ready ( _ ) => { } _ => { self . parking_lot_index . insert ( & txn ) ; parking_lot_txns += 1 ; } } } trace ! ( " " address current_sequence_number txns len ( ) parking_lot_txns ) ; } }
fixes following invariants:
all transactions of given account that are sequential to current sequence number
supposed to be included in both PriorityIndex (ordering for Consensus) and
TimelineIndex (txns for SharedMempool)
Other txns are considered to be "non-ready" and should be added to ParkingLotIndex
fixes following invariants : all transactions of given account that are sequential to current sequence number supposed to be included in both PriorityIndex ( ordering for Consensus ) and TimelineIndex ( txns for SharedMempool ) Other txns are considered to be " non - ready " and should be added to ParkingLotIndex
&mut self
address
&AccountAddress
current_sequence_number
u64
&mut self
address
&AccountAddress
current_sequence_number
u64