fix: if we are within 1 period of getCurrentPeriod manually call sync actions, otherwise call parent sync

This commit is contained in:
Derrick Hammer 2023-09-16 11:12:18 -04:00
parent e6ad5a13ed
commit 65002190b8
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 3 deletions

View File

@ -50,10 +50,14 @@ export default class Client extends BaseClient {
checkpoint.attestedHeader.beacon.slot,
);
this.latestCommittee = checkpoint.nextSyncCommittee.pubkeys;
this.booted = true;
this.emit("synced");
if (this._latestPeriod + 1 === this.getCurrentPeriod()) {
this.booted = true;
this.emit("synced");
await this.getLatestExecution(false);
await this.getLatestExecution(false);
} else {
await super.sync();
}
}
public async rpcCall(method: string, params: any) {