class TransactionPoolImpl implements TransactionPool {

    @Override
    public synchronized TransactionPoolAddResult addTransaction(final Transaction tx) {
        TransactionPoolAddResult internalResult = this.internalAddTransaction(tx);
        List<Transaction> pendingTransactionsAdded = new ArrayList<>();

        if (!internalResult.transactionsWereAdded()) {
            return internalResult;
        } else if(internalResult.pendingTransactionsWereAdded()) {
            pendingTransactionsAdded.add(tx);
            pendingTransactionsAdded.addAll(this.addSuccessors(tx)); // addSuccessors only retrieves pending successors
        }

        this.emitEvents(pendingTransactionsAdded);

        return TransactionPoolAddResult.ok(internalResult.getQueuedTransactionsAdded(), pendingTransactionsAdded);
    }

    public  TransactionPoolImpl(
            RskSystemProperties config,
            RepositoryLocator repositoryLocator,
            BlockStore blockStore,
            BlockFactory blockFactory,
            EthereumListener listener,
            TransactionExecutorFactory transactionExecutorFactory,
            SignatureCache signatureCache,
            int outdatedThreshold,
            int outdatedTimeout);

}