Skip to content

Commit

Permalink
Remove unneeded type
Browse files Browse the repository at this point in the history
  • Loading branch information
danield9tqh committed Nov 20, 2024
1 parent 782096b commit 5c05d21
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ironfish/src/wallet/scanner/walletScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import { BackgroundNoteDecryptor } from './noteDecryptor'
import { RemoteChainProcessor } from './remoteChainProcessor'
import { ScanState } from './scanState'

type ScanFrom = { sequence: number; hash?: Buffer }

export class WalletScanner {
readonly logger: Logger
readonly wallet: Wallet
Expand All @@ -37,7 +35,7 @@ export class WalletScanner {
*/
private scanningAccounts = new Array<{
account: Account
scanFrom: ScanFrom | 'cursor'
scanFrom: { sequence: number; hash?: Buffer } | 'cursor'
}>()

constructor(options: {
Expand Down Expand Up @@ -324,14 +322,14 @@ export class WalletScanner {
}

private async getEarliestHead(): Promise<HeadValue | null | 'none'> {
const withoutCursor: ScanFrom[] = []
const scanFroms: { sequence: number; hash?: Buffer }[] = []
for (const { scanFrom } of this.scanningAccounts) {
if (scanFrom !== 'cursor') {
withoutCursor.push(scanFrom)
scanFroms.push(scanFrom)
}
}

const sorted = withoutCursor.sort((a, b) => a.sequence - b.sequence)
const sorted = scanFroms.sort((a, b) => a.sequence - b.sequence)

for (const scanFrom of sorted) {
if (scanFrom.sequence < GENESIS_BLOCK_SEQUENCE) {
Expand Down

0 comments on commit 5c05d21

Please sign in to comment.