upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/selftest.cpp
diff options
context:
space:
mode:
authorBitflash <btf01@proton.me>2026-07-31 11:27:53 -0300
committerGitHub <noreply@github.com>2026-07-31 11:27:53 -0300
commitf904c4bd4057ab7333c7d701fb40f3e87fedf7fd (patch)
tree13e1ea3da81b741b708692e91455a0618f530718 /src/selftest.cpp
parentf05274afd0becc7311fa69aa60b0215f300e5f28 (diff)
gui: stop stacking every orphan the node ever produced on top of the list (#67)
The wallet list sorted on GetDepthInMainChain() ascending so pending transactions came first. An orphaned coinbase is also depth 0 -- and it stays depth 0 forever, because it is never going to be confirmed. So every orphan a node had ever produced sat permanently at the top of the list, above every block it had actually won. A miner with a week of ordinary orphaned races opened the wallet and saw nothing but failures. The balance was right the whole time; the list was telling a different story. That is how this was found: a screenshot of a healthy, correctly-mining node that looked like it was failing at everything. Sort on (rank, depth) instead, where rank is 0 for pending, 1 for confirmed, 2 for orphaned. Orphans go to the bottom, pending stays on top, confirmed stays ordered most-recent-first. Verified against a datadir whose chain had been reorganised away, so every coinbase in it is orphaned: all 17 wallet transactions classify as rank 2. Not tested against a mixed wallet -- the machine that has one is in production with its datadir locked by the running node.
Diffstat (limited to 'src/selftest.cpp')
0 files changed, 0 insertions, 0 deletions