Skip to content

Commit

Permalink
Stop emitting clock events if aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed May 23, 2023
1 parent 0c5d98e commit cd80dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/beacon-node/src/util/clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class Clock extends EventEmitter implements IClock {
private onNextSlot = (slot?: Slot): void => {
const clockSlot = slot ?? getCurrentSlot(this.config, this.genesisTime);
// process multiple clock slots in the case the main thread has been saturated for > SECONDS_PER_SLOT
while (this._currentSlot < clockSlot) {
while (this._currentSlot < clockSlot && !this.signal.aborted) {
const previousSlot = this._currentSlot;
this._currentSlot++;

Expand Down

0 comments on commit cd80dbe

Please sign in to comment.