Page MenuHomePhabricator

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

Authored by PiRK on Dec 15 2023, 14:28.

Details

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