wallet: wait for monero-wallet-rpc to accept before publishing the child

This commit is contained in:
agent 2026-09-23 20:30:57 -04:00
commit 081bdfac3e
No known key found for this signature in database
2 changed files with 138 additions and 44 deletions

View file

@ -618,6 +618,9 @@ impl WalletChild {
// monero-wallet-rpc creates the wallet file 0600; make that true even if
// it already existed with looser bits.
harden_wallet_file(&self.wallet_dir.join(&self.wallet_filename));
// Do not hand back a client whose port is still closed: `pick_port` only
// proved the port was free, not that the child bound it.
Self::loopback_listener_ready(port, WALLET_RPC_LISTENER_TIMEOUT, "monero-wallet-rpc")?;
Ok(Some(WalletClient {
url: format!("http://{user}:{}@127.0.0.1:{port}/json_rpc", pass.as_str()),
no_spend: false,