Class DroppedTransactionStore

java.lang.Object
nxt.blockchain.DroppedTransactionStore

public class DroppedTransactionStore extends Object
The `DroppedTransactionStore` class handles a collection of comparable data for transactions that have been dropped. It offers functionality to add, retrieve, and clean up entries once the transactions have expired.

This class uses a concurrent map to store known dropped transactions' data and a priority queue to manage its expiration. The priority queue ensures that expired data is cleaned up

The store has a maximum size limit, and if the number of transactions exceeds this limit, the oldest transactions (those closest to expiration) are removed during cleanup.

  • Method Details

    • cleanup

      public void cleanup(int currentTime)
      Cleanup any entries that expired. If the size is bigger than the maxSize proveded when the store is created, remove the entries that will expire sooner
      Parameters:
      currentTime - timestamp in same format and resolution as the expiration provided to add(Long, UtxComparableData, int)
    • getSize

      public int getSize()