Skip to content

Commit

Permalink
making head optoional
Browse files Browse the repository at this point in the history
  • Loading branch information
patnir committed Oct 5, 2023
1 parent f2d361d commit 11cdeca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ironfish-cli/src/commands/service/syncGraffiti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class SyncGraffiti extends IronfishCommand {
}),
head: Flags.string({
char: 's',
required: true,
required: false,
description: 'The block hash to start updating from',
}),
stopSequence: Flags.integer({
Expand Down Expand Up @@ -71,10 +71,10 @@ export default class SyncGraffiti extends IronfishCommand {
async syncBlockGraffiti(
client: RpcClient,
api: WebApi,
head: string,
head: string | undefined,
stopSequence: number,
): Promise<void> {
this.log(`Starting from head ${head}`)
this.log(`Starting from head ${head ? head : 'undefined'}`)

const response = client.chain.followChainStream(head ? { head } : undefined)

Expand All @@ -84,8 +84,8 @@ export default class SyncGraffiti extends IronfishCommand {
if (block.sequence >= stopSequence) {
break
}

await api.updateBlockGraffiti(block.hash, block.graffiti)
this.log('Updated graffiti for block ' + block.hash)
}
}
}

0 comments on commit 11cdeca

Please sign in to comment.