Skip to content

Commit

Permalink
Subscribe to milestone change with connected store
Browse files Browse the repository at this point in the history
  • Loading branch information
rainydio committed Jun 2, 2020
1 parent 67d2b7b commit 16d50ad
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/core-transaction-pool/src/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Container, Contracts, Enums as AppEnums, Providers, Utils as AppUtils } from "@arkecosystem/core-kernel";
import { postConstruct } from "@arkecosystem/core-kernel/dist/ioc";
import { Interfaces } from "@arkecosystem/crypto";

import { TransactionAlreadyInPoolError, TransactionPoolFullError } from "./errors";
Expand Down Expand Up @@ -28,14 +27,11 @@ export class Service implements Contracts.TransactionPool.Service {
@Container.inject(Container.Identifiers.TransactionPoolExpirationService)
private readonly expirationService!: Contracts.TransactionPool.ExpirationService;

@postConstruct()
public initialize() {
public async boot(): Promise<void> {
this.emitter.listen(AppEnums.CryptoEvent.MilestoneChanged, {
handle: () => this.readdTransactions(),
});
}

public async boot(): Promise<void> {
if (process.env.CORE_RESET_DATABASE) {
this.flush();
} else {
Expand Down

0 comments on commit 16d50ad

Please sign in to comment.