@leofcoin/chain 1.4.18 → 1.4.19
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/package.json +1 -1
- package/src/chain.js +2 -2
package/package.json
CHANGED
package/src/chain.js
CHANGED
|
@@ -294,7 +294,7 @@ export default class Chain extends Contract {
|
|
|
294
294
|
debug(`synced ${blocksSynced} ${blocksSynced > 1 ? 'blocks' : 'block'}`)
|
|
295
295
|
|
|
296
296
|
const end = this.#blocks.length
|
|
297
|
-
const start = this.#blocks.length - blocksSynced
|
|
297
|
+
const start = (this.#blocks.length - blocksSynced) - 1
|
|
298
298
|
await this.#loadBlocks(this.blocks.slice(start))
|
|
299
299
|
await this.#updateState(this.#blocks[this.#blocks.length - 1])
|
|
300
300
|
this.#chainSyncing = false
|
|
@@ -391,7 +391,7 @@ async resolveBlock(hash) {
|
|
|
391
391
|
|
|
392
392
|
async #addBlock(block) {
|
|
393
393
|
// console.log(block);
|
|
394
|
-
const blockMessage = await new BlockMessage(
|
|
394
|
+
const blockMessage = await new BlockMessage(block)
|
|
395
395
|
await Promise.all(blockMessage.decoded.transactions
|
|
396
396
|
.map(async transaction => transactionPoolStore.delete(transaction.hash)))
|
|
397
397
|
const hash = await blockMessage.hash()
|