Skip to content

Commit

Permalink
Fix poi offset is 0 (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqiang90 authored Dec 12, 2022
1 parent 23e3262 commit d5462f5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ export abstract class BaseBlockDispatcher<Q extends IQueue>
this.latestProcessedHeight = reindexBlockHeight;
} else {
if (this.nodeConfig.proofOfIndex && !isNullMerkelRoot(operationHash)) {
if (!this.projectService.blockOffset) {
// We only check if it is undefined, need to be caution here when blockOffset is 0
if (this.projectService.blockOffset === undefined) {
// Which means during project init, it has not found offset and set value
await this.projectService.upsertMetadataBlockOffset(height - 1);
}
// this will return if project service blockOffset already exist
void this.projectService.setBlockOffset(height - 1);
}
if (dynamicDsCreated) {
Expand Down

0 comments on commit d5462f5

Please sign in to comment.