class BlockChainManagerImpl implements BlockChainManager<T> {

    @Override
    public void addBlock(ConsensusBlock<T> nextBlock) {
        try {
            lock.lock();
            // A block may contain txs not received by txApi and those txs also have to be stored in the storage
            for (Transaction tx : nextBlock.getBody().getTransactionList()) {
                if (receiptStore.contains(tx.getHash().toString())
                        && receiptStore.get(tx.getHash().toString()).getStatus() != ExecuteStatus.ERROR) {
                    addTransaction(tx);
                }
            }
            batchTxs(nextBlock);

            // Store Block Index and Block Data
            this.blockStore.addBlock(nextBlock);
            setLastConfirmedBlock(nextBlock);

        } finally {
            lock.unlock();
        }
    }

    public  BlockChainManagerImpl(BlockChainStore blockChainStore);

}