Skip to content

Commit

Permalink
fix(indexer): fix predictedClosedHeight prediction for multi-lease de…
Browse files Browse the repository at this point in the history
…ployments
  • Loading branch information
Redm4x committed May 6, 2024
1 parent bc02691 commit c2a28bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion indexer/src/indexers/akashStatsIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ export class AkashStatsIndexer extends Indexer {
deployment.closedHeight = height;
await deployment.save({ transaction: blockGroupTransaction });
} else {
const predictedClosedHeight = deployment.balance / (blockRate - lease.price);
const predictedClosedHeight = Math.ceil((deployment.lastWithdrawHeight || lease.createdHeight) + deployment.balance / (blockRate - lease.price));
await Lease.update({ predictedClosedHeight: predictedClosedHeight }, { where: { deploymentId: deployment.id }, transaction: blockGroupTransaction });
}
}
Expand Down

0 comments on commit c2a28bd

Please sign in to comment.