upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/compactblock.cpp
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-08-23 11:50:12 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-08-23 11:50:12 +0000
commit46864cdf3c90d15d5d21a330bb54f43696aa7d3b (patch)
tree213ce88d42cbc207448c14335c3263a140e40902 /src/compactblock.cpp
parente960802fa7149c9f997074ec7c1a7af66fb47e0f (diff)
payout: say why a grandfathered pair is safe, since it is not the orphan check
The comment on FindRecordedPoolPayout justified the legacy fallback by saying that where two pre-upgrade rounds share a height, the losing one's ledger entry is voided by the orphan check before it can be paid. That check is PayoutBlockStillOnChain(), which returns true for a zero hash -- and every pre-upgrade entry has a zero hash, because they were written before payouts recorded one. So it is a no-op for exactly the population the fallback exists to serve. The stated reason for a safety property was not the reason. The property does hold, by a different mechanism. SamePayoutRound() treats two zero-hash entries at the same height as the same round, so the pair is indistinguishable to every consumer, not just to this one: FlushMaturePayouts explodes one and skips the other as already queued, PaymentInFlightLocked refuses a second record for that (round, address), and RecordPayoutTxid settles against the first match. The pair presents as one debt and can be paid at most once. The cost of that -- only one of a genuine same-height pair would ever be paid -- is now written down too, rather than left as an implication. Both halves are asserted rather than reasoned about: the self-test checks that the orphan check passes a zero hash, and that two identical zero-hash entries at one height produce exactly one in-flight record. Property: the comment describes the mechanism that is actually load-bearing, and a test fails if either half of it stops being true.
Diffstat (limited to 'src/compactblock.cpp')
0 files changed, 0 insertions, 0 deletions