all: use common.FileExist for checking file existence (#24748)

This commit is contained in:
s7v7nislands
2022-04-27 11:48:02 +02:00
committed by GitHub
parent c3a5054c27
commit 5a584c2133
5 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -497,7 +497,7 @@ Check the command description "geth snapshot prune-state --help" for more detail
`
func deleteCleanTrieCache(path string) {
if _, err := os.Stat(path); os.IsNotExist(err) {
if !common.FileExist(path) {
log.Warn(warningLog)
return
}
+1 -1
View File
@@ -58,7 +58,7 @@ func newTxJournal(path string) *txJournal {
// the specified pool.
func (journal *txJournal) load(add func([]*types.Transaction) []error) error {
// Skip the parsing if the journal file doesn't exist at all
if _, err := os.Stat(journal.path); os.IsNotExist(err) {
if !common.FileExist(journal.path) {
return nil
}
// Open the journal for loading any past transactions