Skip to content

Commit

Permalink
fix(ironfish): Guard event loop when the wallet is locked (#5393)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanjadvani committed Sep 19, 2024
1 parent 6fbfd31 commit c5ff945
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions ironfish/src/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,20 @@ export class Wallet {
const [promise, resolve] = PromiseUtils.split<void>()
this.eventLoopPromise = promise

if (!this.scanner.running) {
void this.scan()
}
if (!this.locked) {
if (!this.scanner.running) {
void this.scan()
}

void this.syncTransactionGossip()
await this.cleanupDeletedAccounts()
void this.syncTransactionGossip()
await this.cleanupDeletedAccounts()

const head = await this.getLatestHead()
const head = await this.getLatestHead()

if (head) {
await this.expireTransactions(head.sequence)
await this.rebroadcastTransactions(head.sequence)
if (head) {
await this.expireTransactions(head.sequence)
await this.rebroadcastTransactions(head.sequence)
}
}

if (this.isStarted) {
Expand Down

0 comments on commit c5ff945

Please sign in to comment.