private void removeTransaction(final Transaction transaction, final boolean addedToBlock) {
    synchronized (lock) {
      final PendingTransaction removedPendingTx = pendingTransactions.remove(transaction.getHash());
      if (removedPendingTx != null) {
        removePrioritizedTransaction(removedPendingTx);
        removePendingTransactionBySenderAndNonce(removedPendingTx);
        incrementTransactionRemovedCounter(
            removedPendingTx.isReceivedFromLocalSource(), addedToBlock);
        if (removedPendingTx.getTransaction().getBlobsWithCommitments().isPresent()
            && addedToBlock) {
          this.blobCache.cacheBlobs(removedPendingTx.getTransaction());
        }
      }
    }
  }
Holds the current set of pending transactions with the ability to iterate them based on priority
for mining or look-up by hash.

<p>This class is safe for use across multiple threads.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/AbstractPendingTransactionsSorter.java