wallet: derive readiness from the wallet's get_height, not a nonexistent get_info #204

Merged
sirius merged 2 commits from wt/t_e4e55a04 into main 2026-10-31 05:49:07 +00:00

2026-10-31

Merge branch 'main' into wt/t_e4e55a04
Some checks failed
ci / test (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
2026-10-31 05:48:56 +00:00
rust-dev
wallet: derive readiness from the wallet's get_height, not a nonexistent get_info
Some checks failed
ci / test (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
monero-wallet-rpc does not implement get_info (-32601 Method not found); it
exists on the daemon only. Every wallet therefore sat in syncing forever:
no balance, spends refused, receipts never verified.

Readiness is now the pair:
- the wallet RPC's own get_height (its scanned height), and
- the chain tip from the existing daemon client (GET /get_height).

ready = height > 0 && (tip == 0 || height + 2 >= tip). The 2-block slack is
deliberate: the tip moves every ~2 min and the two reads are not a snapshot.
A daemon that does not answer, a missing height and -13 No wallet file are
all not-ready, never an error banner.

ChildConfig::daemon_probe_addr resolves a tip source for clearnet remotes
(the wallet child already dials them); a .onion daemon is not dialled without
the SOCKS child and stays fail-closed. docs/WALLET.md now documents the real
rule. Tests cover -32601 get_info, equal tip, slack boundary, dead daemon and
the no-wallet-file answer.
2026-10-31 01:35:15 -04:00