Skip to content

Commit

Permalink
Update listener.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuripetusko committed Feb 26, 2022
1 parent a829013 commit a1436dc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rmrk2.0.0/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,16 @@ export class RemarkListener {
latestBlock + 1
} and ${to}`
);
return await fetchRemarks(
const remarks = await fetchRemarks(
this.apiPromise,
latestBlock + 1,
to,
this.prefixes
);

this.logger(`Found ${remarks.length} remarks`);

return remarks;
} catch (error: any) {
console.log(error);
return [];
Expand Down Expand Up @@ -310,6 +314,10 @@ export class RemarkListener {
}
}

if (filteredCalls.length < 1 && this.missingBlockCalls.length > 0) {
await this.consolidate();
}

if (filteredCalls.length > 0) {
const blockCalls: BlockCalls = {
block: latestFinalisedBlockNum,
Expand Down

0 comments on commit a1436dc

Please sign in to comment.