diff --git a/package-lock.json b/package-lock.json index 64fdbfd9..b4cc339d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7112,7 +7112,7 @@ }, "packages/chain": { "name": "@leofcoin/chain", - "version": "1.6.5", + "version": "1.6.8", "license": "MIT", "dependencies": { "@leofcoin/addresses": "^1.0.22", diff --git a/packages/chain/package.json b/packages/chain/package.json index a03b0f8e..6fed12fa 100644 --- a/packages/chain/package.json +++ b/packages/chain/package.json @@ -1,6 +1,6 @@ { "name": "@leofcoin/chain", - "version": "1.6.6", + "version": "1.6.8", "description": "Official javascript implementation", "private": false, "exports": { diff --git a/packages/chain/src/chain.ts b/packages/chain/src/chain.ts index 37740e4d..513e3d9f 100644 --- a/packages/chain/src/chain.ts +++ b/packages/chain/src/chain.ts @@ -275,6 +275,9 @@ export default class Chain extends VersionControl { // @ts-ignore transaction.hash = hash } + if (!(await transactionStore.has(hash))) { + transactionStore.put(hash, await blockMessage.hash()) + } ;(await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash)) return transaction @@ -526,7 +529,7 @@ export default class Chain extends VersionControl { try { const has = await globalThis.transactionPoolStore.has(hash) - if (!has) { + if (!has && !(await transactionStore.has(hash))) { await globalThis.transactionPoolStore.put(hash, transaction.encoded) } if (this.#participating && !this.#runningEpoch) this.#runEpoch() diff --git a/packages/chain/test/chain.js b/packages/chain/test/chain.js index b2405bc1..56d10665 100644 --- a/packages/chain/test/chain.js +++ b/packages/chain/test/chain.js @@ -96,7 +96,7 @@ for (let i = 0; i < 1000; i++) { nonce, params: [ peernet.selectedAccount, - 'YTqxcZqw8irJDRUBbuLq5ijuTycDmVfkKSmnx22eVrbxJB6Gf4FGD', + 'YTqwkCFzxdPM1q45745tEefNMo9Zn9QzwUVDmUNWkve6Xz7zBgw24', chain.utils.parseUnits('10').toString() ] })