wallet: derive readiness from the wallet's get_height, not a nonexistent get_info #204
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_e4e55a04"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was broken
monero-wallet-rpchas noget_info— it answers-32601 Method not found. The readiness probe asked it anyway, so every wallet read as unsynced forever: no balance, spends refused withNOT_SYNCED_MSG, receipts never verified.Verified live on this host (monero-wallet-rpc v0.18.5.1):
The fix
Wallet::chain_info()asks the wallet RPC forget_height(its own scanned height) and the daemon client (daemon_get_height,GET /get_height) for the tip.get_infois never asked of the wallet RPC.height > 0 && (tip == 0 || height + 2 >= tip). Two blocks of deliberate slack — the tip moves every ~2 min and the two reads are not a snapshot — so a wallet at the tip does not flap.-13 No wallet fileall read not-ready. "No wallet open" is a state, not an error banner (chain_ready→Ok(false)).ChildConfig::daemon_probe_addr()now resolves a tip source for a clearnet remote daemon the user typed (the wallet child already dials it). A .onion daemon is still not dialled without the SOCKS child: fail-closed (height-only), documented.Node::wallet_child_refresh,Node::tipand receipt ingest attach the probe from the child config; the status row showswallet_height/daemon_tip.docs/WALLET.mdreadiness section now documents the real rule (spec matches main).Verification
cargo testgreen; new tests:readiness_never_asks_the_wallet_rpc_for_get_info,a_wallet_within_the_slack_of_the_daemon_tip_is_ready,an_unreachable_daemon_is_not_ready,an_rpc_with_no_wallet_open_is_not_ready_and_not_an_error,a_missing_or_zero_wallet_height_is_not_ready.cargo clippy --all-targets -- -D warningsclean.Ok(true); tip 3790000 →Ok(false); no daemon →Ok(false). The ready flip is proven against a stub daemon, not a live chain (no monerod on this host).Rebased on main @
dddf74f(includes #202). Do not merge — Lance merges.