diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 11:22:32 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 11:22:32 +0000 |
| commit | 6c0ed67a2f6b39b630c5748ecf214f86e9d26a5c (patch) | |
| tree | d08c42d440061028edc46761f568964472fc7a6f /src/main.cpp | |
| parent | c9353e8f8a4d95c827497abe5b30ac951dd7dda5 (diff) | |
payout: leave no temporary file behind, and say so where it will be read
Every failure path in WriteFileAtomic returned without removing
"<path>.tmp". A disk that filled up once, or a single EIO, left a short
file called pending_payouts.json.tmp sitting next to a good ledger for
as long as the node ran. That file is worse than no file: it carries the
name of a half-finished save, and the operator cleaning up after the
incident is precisely the person who will move it into place and publish
a ledger missing whatever had not been written yet.
The failures also logged under LogPrint("payout", ...). pool_status.json
is written through the same function but everything else about it is
logged under "pool", so an operator running -debug=pool was told nothing
when the status file could not be replaced -- the message existed and
was discarded for having the wrong category. They now print
unconditionally: a write failure is not a trace of normal operation, it
is the file that is about to be read not being there, and gating it on a
category chosen before the failure happened is how it went missing. The
brief's alternative, a category argument, would still have required the
right guess in advance.
Properties: no failure of WriteFileAtomic leaves a .tmp behind, and no
failure of it is invisible at default log settings.
Diffstat (limited to 'src/main.cpp')
0 files changed, 0 insertions, 0 deletions