@xyo-network/xl1-protocol-sdk 1.26.34 → 1.26.35

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.
@@ -4717,12 +4717,14 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4717
4717
  pruned += pruneHashes.length;
4718
4718
  total += batch.length;
4719
4719
  await this.pendingBlocksArchivist.delete(pruneHashes);
4720
- cursor = batch.at(-1)?._sequence;
4721
- batch = cursor ? await this.pendingBlocksArchivist.next({
4720
+ const pruneSet = new Set(pruneHashes);
4721
+ const lastSurvivor = batch.findLast((p) => !pruneSet.has(p._hash));
4722
+ cursor = lastSurvivor?._sequence ?? cursor;
4723
+ batch = await this.pendingBlocksArchivist.next({
4722
4724
  limit: batchSize,
4723
4725
  cursor,
4724
4726
  order: "desc"
4725
- }) : [];
4727
+ });
4726
4728
  }
4727
4729
  this.logger?.debug(`prunePendingBlocks completed: pruned=${pruned}, totalChecked=${total}`);
4728
4730
  return [pruned, total];
@@ -4777,12 +4779,14 @@ var SimpleMempoolRunner = class extends AbstractCreatableProvider {
4777
4779
  pruned += pruneHashes.length;
4778
4780
  total += batch.length;
4779
4781
  await this.pendingTransactionsArchivist.delete(pruneHashes);
4780
- cursor = batch.at(-1)?._sequence;
4781
- batch = cursor ? await this.pendingTransactionsArchivist.next({
4782
+ const pruneSet = new Set(pruneHashes);
4783
+ const lastSurvivor = batch.findLast((p) => !pruneSet.has(p._hash));
4784
+ cursor = lastSurvivor?._sequence ?? cursor;
4785
+ batch = await this.pendingTransactionsArchivist.next({
4782
4786
  limit: batchSize,
4783
4787
  cursor,
4784
4788
  order: "desc"
4785
- }) : [];
4789
+ });
4786
4790
  }
4787
4791
  this.logger?.debug(`prunePendingTransactions completed: pruned=${pruned}, totalChecked=${total}`);
4788
4792
  return [pruned, total];