Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
Creating two wallets with load_on_startup=true
simultaneously will result in only one of the wallets being added to the startup file.
Expected behaviour
Both wallets should be added.
Steps to reproduce
I don’t have an easy script to reproduce this, but the issue is quite visible in the code: https://github.com/bitcoin/bitcoin/blob/389cf32aca0be6c4b01151c92cc3be79c120f197/src/wallet/wallet.cpp#L94
The setting gets read from a backing JSON file, manipulated in memory, and then saved to the file, without any lock being taken out.
It’s likely possible to demonstrate this with a quick BASH or python script that fires up bitcoind and creates two wallets simultaneously.
Relevant log output
No response
How did you obtain Bitcoin Core
Pre-built binaries
What version of Bitcoin Core are you using?
27.1
Operating system and version
MacOS Sonoma 14.6.1
Machine specifications
No response