@leofcoin/chain 1.5.59 → 1.5.61
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 +2 -1
- package/exports/chain.js +2 -1
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -4933,7 +4933,9 @@ class Chain extends VersionControl {
|
|
|
4933
4933
|
}
|
|
4934
4934
|
}
|
|
4935
4935
|
async #addBlock(block) {
|
|
4936
|
+
console.log({ block });
|
|
4936
4937
|
const blockMessage = await new BlockMessage(block);
|
|
4938
|
+
const hash = await blockMessage.hash();
|
|
4937
4939
|
await Promise.all(blockMessage.decoded.transactions
|
|
4938
4940
|
// @ts-ignore
|
|
4939
4941
|
.map(async (transaction) => {
|
|
@@ -4945,7 +4947,6 @@ class Chain extends VersionControl {
|
|
|
4945
4947
|
(await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
|
|
4946
4948
|
return transaction;
|
|
4947
4949
|
}));
|
|
4948
|
-
const hash = await blockMessage.hash();
|
|
4949
4950
|
await globalThis.blockStore.put(hash, blockMessage.encoded);
|
|
4950
4951
|
if ((await this.lastBlock).index < Number(blockMessage.decoded.index))
|
|
4951
4952
|
await this.updateState(blockMessage);
|
package/exports/chain.js
CHANGED
|
@@ -1344,7 +1344,9 @@ class Chain extends VersionControl {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
1346
|
async #addBlock(block) {
|
|
1347
|
+
console.log({ block });
|
|
1347
1348
|
const blockMessage = await new BlockMessage(block);
|
|
1349
|
+
const hash = await blockMessage.hash();
|
|
1348
1350
|
await Promise.all(blockMessage.decoded.transactions
|
|
1349
1351
|
// @ts-ignore
|
|
1350
1352
|
.map(async (transaction) => {
|
|
@@ -1356,7 +1358,6 @@ class Chain extends VersionControl {
|
|
|
1356
1358
|
(await transactionPoolStore.has(hash)) && (await transactionPoolStore.delete(hash));
|
|
1357
1359
|
return transaction;
|
|
1358
1360
|
}));
|
|
1359
|
-
const hash = await blockMessage.hash();
|
|
1360
1361
|
await globalThis.blockStore.put(hash, blockMessage.encoded);
|
|
1361
1362
|
if ((await this.lastBlock).index < Number(blockMessage.decoded.index))
|
|
1362
1363
|
await this.updateState(blockMessage);
|