#11266·monero

Add optional flag to persist wallet state synchronously before responding

Author: napolyCreated Sep 7, 2026Updated Sep 10, 2026

The create_address bumps the wallet's in-memory subaddress index and returns the new address immediately. The updated index is not written to the wallet keys file until the next store().. which happens on its own schedule (store RPC call, clean shutdown..), not tied to the address-creation call itself.

This means a caller can receive an address from create_address, treat it as valid and start directing funds to it, and have that address effectively "disappear" from the wallet's perspective if the process terminates (crash, OOM kill, power loss..) before the next persist. On restart, the index has not advanced, and the next create_address call reissues an index that was already handed out and may already be in use elsewhere in a caller's system.

Please add an optional parameter (or startup flag) that makes the RPC call block until the new address/index has been durably written to the wallet file before responding.

(Arguably this should be the default, but making it opt-in avoids any behavior/performance change for existing callers.)

related to: https://github.com/btcpay-monero/btcpayserver-monero-plugin/issues/57 https://github.com/btcpayserver/btcpayserver/pull/7483