@leofcoin/chain 1.7.120 → 1.7.121

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.
@@ -5006,7 +5006,6 @@ class State extends Contract {
5006
5006
  }
5007
5007
  if (!lastBlock)
5008
5008
  lastBlock = await this.#getLatestBlock();
5009
- console.log('starting sync');
5010
5009
  if (globalThis.peernet.peers.length === 0)
5011
5010
  return 'connectionless';
5012
5011
  try {
@@ -5053,7 +5052,7 @@ class State extends Contract {
5053
5052
  let blocksSynced = localIndex > 0 ? (localIndex > index ? localIndex - index + 1 : index + -localIndex + 1) : index + 1;
5054
5053
  debug$1(`synced ${blocksSynced} ${blocksSynced > 1 ? 'blocks' : 'block'}`);
5055
5054
  const blocks = this.#blocks;
5056
- const start = blocks.length - blocksSynced;
5055
+ const start = localIndex - blocksSynced;
5057
5056
  if (this.#machine) {
5058
5057
  await this.#loadBlocks(blocks.slice(start));
5059
5058
  }
package/exports/chain.js CHANGED
@@ -1133,7 +1133,6 @@ class State extends Contract {
1133
1133
  }
1134
1134
  if (!lastBlock)
1135
1135
  lastBlock = await this.#getLatestBlock();
1136
- console.log('starting sync');
1137
1136
  if (globalThis.peernet.peers.length === 0)
1138
1137
  return 'connectionless';
1139
1138
  try {
@@ -1180,7 +1179,7 @@ class State extends Contract {
1180
1179
  let blocksSynced = localIndex > 0 ? (localIndex > index ? localIndex - index + 1 : index + -localIndex + 1) : index + 1;
1181
1180
  debug$1(`synced ${blocksSynced} ${blocksSynced > 1 ? 'blocks' : 'block'}`);
1182
1181
  const blocks = this.#blocks;
1183
- const start = blocks.length - blocksSynced;
1182
+ const start = localIndex - blocksSynced;
1184
1183
  if (this.#machine) {
1185
1184
  await this.#loadBlocks(blocks.slice(start));
1186
1185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.120",
3
+ "version": "1.7.121",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {