fix: data integrity risk from unhandled fclose(3) failures
Problem
Bitcoin-abc has the same security issue described in https://github.com/bitcoin/bitcoin/pull/29307.
fclose(3) failure may prevent previously written data from being properly flushed to disk. Current code ignores fclose(3) failures, leaving file close errors undetected and unhandled.
Upstream Fix
PR https://github.com/bitcoin/bitcoin/pull/29307: "util: explicitly close all AutoFiles that have been written"
Thanks for reporting. We will update the code to better handle fclose() errors. Please note that this does not improve data integrity but improve error reporting when data might have failed to be written to disk.
I don't know what I'm doing its overwhelming, what is this and why am I doing it. I'm homeless broke and have congestive heart failure. I don't get it. Please help me understand I'm so sorry.