Skip to content

Commit

Permalink
Merge pull request #1144 from nervosnetwork/fix-regenerate
Browse files Browse the repository at this point in the history
fix: only resetEndBlockNumber if number > 0
  • Loading branch information
ashchan authored Nov 18, 2019
2 parents dd48b47 + 736a65f commit 441f173
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/neuron-wallet/src/services/sync/block-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export default class BlockListener {
const endBlockNumber: string = this.tipBlockNumber.toString()

if (this.queue) {
this.queue.resetEndBlockNumber(endBlockNumber)
if (this.tipBlockNumber > BigInt(0)) {
this.queue.resetEndBlockNumber(endBlockNumber)
}
} else {
const startBlockNumber: string = await this.getStartBlockNumber()
this.queue = new Queue(
Expand Down

0 comments on commit 441f173

Please sign in to comment.