Skip to content

Commit

Permalink
fix(core-transaction-pool): keep previously forged transaction (#4390)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainydio committed May 17, 2021
1 parent ee8c5e3 commit 2789331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion __tests__/unit/core-transaction-pool/service.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Container, Contracts, Enums } from "@arkecosystem/core-kernel";
import { Identities, Managers, Transactions } from "@arkecosystem/crypto";

import { Service } from "@packages/core-transaction-pool/src/service";
import { Service } from "../../../packages/core-transaction-pool/src/service";

const configuration = {
getRequired: jest.fn(),
Expand Down
4 changes: 4 additions & 0 deletions packages/core-transaction-pool/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ export class Service implements Contracts.TransactionPool.Service {
const expiredHeight: number = lastHeight - maxTransactionAge;

for (const { height, id, serialized } of this.storage.getAllTransactions()) {
if (previouslyForgedTransactions.find((t) => t.id === id)) {
continue;
}

if (height > expiredHeight) {
try {
const previouslyStoredTransaction = Transactions.TransactionFactory.fromBytes(serialized);
Expand Down

0 comments on commit 2789331

Please sign in to comment.