@leofcoin/chain 1.5.60 → 1.5.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/browser/chain.js +1 -1
- package/exports/chain.js +1 -1
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -4935,6 +4935,7 @@ class Chain extends VersionControl {
|
|
|
4935
4935
|
async #addBlock(block) {
|
|
4936
4936
|
console.log({ block });
|
|
4937
4937
|
const blockMessage = await new BlockMessage(block);
|
|
4938
|
+
const hash = await blockMessage.hash();
|
|
4938
4939
|
await Promise.all(blockMessage.decoded.transactions
|
|
4939
4940
|
// @ts-ignore
|
|
4940
4941
|
.map(async (transaction) => {
|
|
@@ -4946,7 +4947,6 @@ class Chain extends VersionControl {
|
|
|
4946
4947
|
(await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
|
|
4947
4948
|
return transaction;
|
|
4948
4949
|
}));
|
|
4949
|
-
const hash = await blockMessage.hash();
|
|
4950
4950
|
await globalThis.blockStore.put(hash, blockMessage.encoded);
|
|
4951
4951
|
if ((await this.lastBlock).index < Number(blockMessage.decoded.index))
|
|
4952
4952
|
await this.updateState(blockMessage);
|
package/exports/chain.js
CHANGED
|
@@ -1346,6 +1346,7 @@ class Chain extends VersionControl {
|
|
|
1346
1346
|
async #addBlock(block) {
|
|
1347
1347
|
console.log({ block });
|
|
1348
1348
|
const blockMessage = await new BlockMessage(block);
|
|
1349
|
+
const hash = await blockMessage.hash();
|
|
1349
1350
|
await Promise.all(blockMessage.decoded.transactions
|
|
1350
1351
|
// @ts-ignore
|
|
1351
1352
|
.map(async (transaction) => {
|
|
@@ -1357,7 +1358,6 @@ class Chain extends VersionControl {
|
|
|
1357
1358
|
(await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
|
|
1358
1359
|
return transaction;
|
|
1359
1360
|
}));
|
|
1360
|
-
const hash = await blockMessage.hash();
|
|
1361
1361
|
await globalThis.blockStore.put(hash, blockMessage.encoded);
|
|
1362
1362
|
if ((await this.lastBlock).index < Number(blockMessage.decoded.index))
|
|
1363
1363
|
await this.updateState(blockMessage);
|