upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-08-23 11:46:03 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-08-23 11:46:03 +0000
commit9e5dc16941ac34e77157d85692d1774d8698b1b4 (patch)
treea2fe11071d42d8743795ca655bd64ff3f3444598 /src/main_gui.cpp
parent3ec75952d9142bb5aa58307fc5a07db264ecdb24 (diff)
payout: quarantine a ledger that failed to load instead of overwriting it
All three loaders push entries into the live structure inside the try block, so an exception part way down a file leaves a PARTIAL picture in memory: the entries before the bad one, and nothing after it. Both loaders then return normally, having logged one line under a debug category, and the node carries on as though that were the whole ledger. The first publish afterwards writes the partial state over the file. ReconcilePayouts publishes unconditionally during startup, so that is milliseconds later -- before an operator could see the warning, let alone act on it. The only durable record of what the pool owed is then gone, and it is gone in the direction that costs miners money: the entries that failed to parse are the ones that vanish. 86b39b9's own commit message names this failure mode and then fixes only the write side. On any parse exception the file is now renamed to <path>.bad.<timestamp>, the path is added to a refusal set, and PublishVersioned declines to write it for the rest of the process. A node that has lost its ledger now comes up visibly missing it rather than quietly appearing to owe nobody anything, and the bytes are still there to reconcile against. Restarting into the same fault does not consume the evidence, because the quarantine name carries the time. Logged with printf rather than LogPrint: an operator who has just lost a payout ledger has to be told at whatever settings they were already running, and the name the file was moved to is the only route back to the data. Property: a payout file that did not parse completely is never overwritten by what did parse.
Diffstat (limited to 'src/main_gui.cpp')
0 files changed, 0 insertions, 0 deletions