diff --git a/modAionImpl/src/org/aion/zero/impl/pendingState/AionPendingStateImpl.java b/modAionImpl/src/org/aion/zero/impl/pendingState/AionPendingStateImpl.java index 414e679616..80622876d6 100644 --- a/modAionImpl/src/org/aion/zero/impl/pendingState/AionPendingStateImpl.java +++ b/modAionImpl/src/org/aion/zero/impl/pendingState/AionPendingStateImpl.java @@ -27,13 +27,6 @@ import org.aion.base.AionTransaction; import org.aion.base.PooledTransaction; import org.aion.base.TxUtil; -import org.aion.evtmgr.IEvent; -import org.aion.evtmgr.IEventMgr; -import org.aion.evtmgr.IHandler; -import org.aion.evtmgr.impl.callback.EventCallback; -import org.aion.evtmgr.impl.es.EventExecuteService; -import org.aion.evtmgr.impl.evt.EventBlock; -import org.aion.evtmgr.impl.evt.EventTx; import org.aion.log.AionLoggerFactory; import org.aion.log.LogEnum; import org.aion.mcf.blockchain.Block; @@ -108,16 +101,12 @@ public TransactionSortedSet() { private final ITxPool txPool; - private IEventMgr evtMgr = null; - private RepositoryCache pendingState; private AtomicReference best; private PendingTxCache pendingTxCache; - private EventExecuteService ees; - private List txBuffer; /** @@ -218,31 +207,6 @@ private synchronized void processTxBuffer() { } } - private final class EpPS implements Runnable { - - boolean go = true; - - /** - * When an object implementing interface Runnable is used to create a thread, - * starting the thread causes the object's run method to be called in that - * separately executing thread. - * - *

The general contract of the method run is that it may take any action - * whatsoever. - * - * @see Thread#run() - */ - @Override - public void run() { - while (go) { - IEvent e = ees.take(); - if (e.getEventType() == IHandler.TYPE.POISONPILL.getValue()) { - go = false; - } - } - } - } - private synchronized void backupPendingTx() { if (!backupPendingPoolAdd.isEmpty()) { @@ -320,7 +284,6 @@ public void init(final AionBlockchainImpl blockchain, boolean test) { if (!this.isSeed) { this.transactionStore = blockchain.getTransactionStore(); - this.evtMgr = blockchain.getEventMgr(); this.poolBackUpEnable = CfgAion.inst().getTx().getPoolBackup(); this.replayTxBuffer = new ArrayList<>(); this.pendingTxCache = @@ -329,14 +292,6 @@ public void init(final AionBlockchainImpl blockchain, boolean test) { this.dumpPool = test || CfgAion.inst().getTx().getPoolDump(); - ees = new EventExecuteService(1000, "EpPS", Thread.MAX_PRIORITY, LOGGER_TX); - ees.setFilter(setEvtFilter()); - - IHandler blkHandler = this.evtMgr.getHandler(IHandler.TYPE.BLOCK0.getValue()); - if (blkHandler != null) { - blkHandler.eventCallback(new EventCallback(ees, LOGGER_TX)); - } - if (poolBackUpEnable) { this.backupPendingPoolAdd = new HashMap<>(); this.backupPendingCacheAdd = new HashMap<>(); @@ -351,25 +306,7 @@ public void init(final AionBlockchainImpl blockchain, boolean test) { this.txBuffer = Collections.synchronizedList(new ArrayList<>()); } - - if (!test) { - ees.start(new EpPS()); - } - } - } - - private Set setEvtFilter() { - Set eventSN = new HashSet<>(); - - int sn = IHandler.TYPE.BLOCK0.getValue() << 8; - eventSN.add(sn + EventBlock.CALLBACK.ONBEST0.getValue()); - - if (poolBackUpEnable) { - sn = IHandler.TYPE.TX0.getValue() << 8; - eventSN.add(sn + EventTx.CALLBACK.TXBACKUP0.getValue()); } - - return eventSN; } public synchronized RepositoryCache getRepository() { @@ -1105,10 +1042,6 @@ public void shutDown() { if (this.bufferEnable) { ex.shutdown(); } - - if (ees != null) { - ees.shutdown(); - } } public synchronized void DumpPool() {