diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 11:48:26 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 11:48:26 +0000 |
| commit | c7ada00eeed8ef689b976c7201db2d9c076c17d1 (patch) | |
| tree | c3abe9a9d71f076c02927fb111fe19d79663e780 /src/wallet_sqlite.cpp | |
| parent | 9e5dc16941ac34e77157d85692d1774d8698b1b4 (diff) | |
payout: refuse to publish a snapshot that was never stamped
PublishVersioned drops a default-constructed VersionedBlob only by
accident. Every serialiser stamps `++gSeq`, so it never produces 0, and
0 then loses the `seq <= publishedSeq` comparison because publishedSeq
starts at 0. Both halves of that are incidental. A serialiser written as
`seq = gSeq++` -- one character different, and the natural way to write
it -- publishes seq 0 for its first snapshot, which would sail past the
comparison on a fresh process and write an empty ledger over a real one.
There is also a live path that produces an unstamped blob today:
FlushMaturePayouts declares `VersionedBlob ledgerSnap` and only fills it
if something was voided, then publishes unconditionally. It is harmless
for exactly the reasons above, which is to say for no reason that is
written down anywhere.
One line, checked explicitly, so the guarantee does not depend on how a
future serialiser spells its increment.
Property: a blob that was never stamped with a version is never written
to disk.
Diffstat (limited to 'src/wallet_sqlite.cpp')
0 files changed, 0 insertions, 0 deletions