HomePhabricator

assumeutxo: catch and log fs::remove error instead of two exist checks

Description

assumeutxo: catch and log fs::remove error instead of two exist checks

Summary:
Fixes a block of code which seems to be incorrectly performing two existence checks instead of catching and logging errors. fs::remove returns false only if the file being removed does not exist, so it is redundant with the fs::exists check. If an error does occur when trying to remove an existing file, fs::remove will throw.

This is a backport of core#26828

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14995

Details

Provenance
Andrew Toth <andrewstoth@gmail.com>Authored on Jan 5 2023, 22:35
PiRKCommitted on Dec 18 2023, 09:07
PiRKPushed on Dec 18 2023, 09:07
Reviewer
Restricted Project
Differential Revision
D14995: assumeutxo: catch and log fs::remove error instead of two exist checks
Parents
rABC6509e002dfb8: [Automated] Update chainparams
Branches
Unknown
Tags
Unknown