Add wallet recovery balance audit - #117
Conversation
|
Reviewed, built, and tested against real coin. Good work — this is the kind of contribution that lands well: read-only, one clear boundary, and a test that fails if the feature breaks. What I verified
Correct on every count: it finds both outputs, recognises them as phrase-backed, and correctly skips the funding transaction that is already spent.
One thing I want fixed before this mergesImmature coinbase falls outside both buckets, and an empty bucket turns into a green reassurance.
Concrete failure: a user mines for two hours with no phrase — every coin immature, all on random pre-seed pool keys — and then creates a recovery phrase. The audit computes zero legacy and zero recoverable, so the dialog shows
in green. They delete their This is the failure shape that has cost this project the most: a broken state that is indistinguishable from a healthy one, phrased as good news. Smallest fix that closes it: a third bucket ( Smaller notes, none blocking
Fix the immature-coinbase gap and I will merge this. |
26da362 to
e27d613
Compare
|
Fixed in the updated branch. What changed:
Re-tested:
All self-tests pass, including the new immature-reward assertions. |
|
Re-reviewed and merging. The immature gap is closed properly: immature coinbase is now counted and split by coverage rather than dropped, so the totals still reconcile with Verified on my side, not taken on trust:
Also good calls on the two smaller ones: surfacing the derivation truncation instead of letting it masquerade as legacy coins, and dropping the green line on an empty wallet. Thanks — this is the third clean one in a row. |
Summary
/recoveryauditcommand-line diagnostic and include the same coverage check in the wallet HD self-test.Why
After recovery phrases landed, the riskiest remaining wallet promise is not just deriving future receive/change keys. It is making sure the user can see whether today's spendable balance would actually come back from the words they wrote down. Pre-seed keys can still exist in wallet.dat, and if they hold coins the phrase alone is not a complete backup.
This PR does not try to finish BIP44 or migrate coins automatically. It makes the current recovery boundary visible and testable before a larger path/interop change.
Testing
git diff --checkmake -f makefile.mingw testsfrom MSYS2 UCRT64 insrc/