diff --git a/__tests__/integration/core-transaction-pool/processor.test.ts b/__tests__/integration/core-transaction-pool/processor.test.ts index 80af570165..a81a4f2728 100644 --- a/__tests__/integration/core-transaction-pool/processor.test.ts +++ b/__tests__/integration/core-transaction-pool/processor.test.ts @@ -100,6 +100,7 @@ describe("Transaction Guard", () => { const transaction = TransactionFactory.transfer(walletGen.address, 2 * 100000000) .withNetwork("unitnet") + .withNonce(wallet.nonce.plus(1)) .withPassphrase(walletGen.passphrase) .build()[0]; diff --git a/packages/core-transaction-pool/src/connection.ts b/packages/core-transaction-pool/src/connection.ts index f0170b79ad..504db79c3e 100644 --- a/packages/core-transaction-pool/src/connection.ts +++ b/packages/core-transaction-pool/src/connection.ts @@ -216,16 +216,14 @@ export class Connection implements TransactionPool.IConnection { transaction.typeGroup, ); - const senderWallet: State.IWallet = this.walletManager.hasByPublicKey(senderPublicKey) - ? this.walletManager.findByPublicKey(senderPublicKey) - : undefined; + await transactionHandler.applyToRecipient(transaction, this.walletManager); + + const senderWallet: State.IWallet = this.walletManager.findByPublicKey(senderPublicKey); const recipientWallet: State.IWallet = this.walletManager.hasByAddress(data.recipientId) ? this.walletManager.findByAddress(data.recipientId) : undefined; - await transactionHandler.applyToRecipient(transaction, this.walletManager); - if (exists) { this.removeTransaction(transaction); } else if (senderWallet) {