private void removeProcessedLines(final File saveFile, final long processedLines)
        throws IOException {

      LOG.debug("Removing processed lines from save file");

      final var tmp = File.createTempFile(saveFile.getName(), ".tmp");

      try (final BufferedReader reader =
              Files.newBufferedReader(saveFile.toPath(), StandardCharsets.US_ASCII);
          final BufferedWriter writer =
              Files.newBufferedWriter(tmp.toPath(), StandardCharsets.US_ASCII)) {
        reader
            .lines()
            .skip(processedLines)
            .forEach(
                line -> {
                  try {
                    writer.write(line);
                    writer.newLine();
                  } catch (IOException e) {
                    throw new RuntimeException(e);
                  }
                });
      }

      saveFile.delete();
      Files.move(tmp.toPath(), saveFile.toPath());
    }
Maintains the set of pending transactions received from JSON-RPC or other nodes. Transactions are
removed automatically when they are included in a block on the canonical chain and re-added if a
re-org removes them from the canonical chain again.

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