11import os from 'os' ;
22import path from 'path' ;
3- import * as fs from 'fs' ;
43import { app , dialog , BrowserWindow , screen , shell } from 'electron' ;
54import type { Event } from 'electron' ;
65import EventEmitter from 'events' ;
@@ -25,7 +24,6 @@ import {
2524 RTS_FLAGS ,
2625 stateDirectoryPath ,
2726} from './config' ;
28-
2927import { setupCardanoNode } from './cardano/setup' ;
3028import { CardanoNode } from './cardano/CardanoNode' ;
3129import { safeExitWithCode } from './utils/safeExitWithCode' ;
@@ -135,50 +133,8 @@ const handleWindowClose = async (event: Event | null | undefined) => {
135133 await safeExit ( ) ;
136134} ;
137135
138- const clearLedger = async ( ) => {
139- const flagFileShortName = 'has_upgraded_to_pv_10' ;
140- const chainLedgerDir = 'chain/ledger' ;
141-
142- const flagFileLongName = path . join (
143- launcherConfig . stateDir ,
144- flagFileShortName
145- ) ;
146-
147- // Check if the flag file exists
148- if ( fs . existsSync ( flagFileLongName ) ) {
149- logger . info ( `${ flagFileLongName } found. NoHskpg.` ) ;
150- } else {
151- try {
152- const chainLedgerLongName = path . join (
153- launcherConfig . stateDir ,
154- chainLedgerDir
155- ) ;
156-
157- const files = fs . readdirSync ( chainLedgerLongName ) ;
158-
159- for ( const file of files ) {
160- // DelIterator
161- const filePath = path . join ( chainLedgerLongName , file ) ;
162- if ( fs . lstatSync ( filePath ) . isFile ( ) ) {
163- // ?it's a file
164- fs . unlinkSync ( filePath ) ;
165- logger . info ( `HskpgDone: ${ filePath } ` ) ;
166- }
167- }
168-
169- // Create v10-upgraded completed marker
170- fs . writeFileSync ( flagFileLongName , 'HskpgNwFlag' ) ;
171- } catch ( err ) {
172- logger . error ( `Error removing files: ${ err } ` ) ;
173- }
174- }
175- } ;
176-
177136const onAppReady = async ( ) => {
178137 setupLogging ( ) ;
179-
180- await clearLedger ( ) ;
181-
182138 await logUsedVersion (
183139 environment . version ,
184140 path . join ( pubLogsFolderPath , 'Daedalus-versions.json' )
0 commit comments