Bitcoin Core 0.15.1 has Multi wallets support:
bitcoin.conf we can add multiple entries of:
wallet=wallet-1.dat wallet=wallet-2.dat wallet=wallet-3.dat wallet=wallet-4.dat ... wallet=wallet-350.dat
When Bitcoin Core starts, if the wallet file does not exists it will create it. which is great for our needs.
However, it always crashes on the 333 wallet. with
Lock table is out of available locker entries
2018-02-13 14:47:05 init message: Loading wallet... 2018-02-13 14:47:05 nFileVersion = 160000 2018-02-13 14:47:05 Keys: 21 plaintext, 0 encrypted, 21 w/ metadata, 21 total 2018-02-13 14:47:05 wallet 36ms 2018-02-13 14:47:05 setKeyPool.size() = 20 2018-02-13 14:47:05 mapWallet.size() = 0 2018-02-13 14:47:05 mapAddressBook.size() = 0 2018-02-13 14:47:05 init message: Loading wallet... 2018-02-13 14:47:05 ************************ EXCEPTION: St13runtime_error CDB: Error 12, can't open database wallet-333.dat D:\BitcoinCore\bitcoin-0.16.0\bin\bitcoin-qt.exe in Runaway exception
I also tried to minimize the
-keypool=20 so that the wallets size will be much smaller in size, and the process of loading them is much faster.
I was suggested that this error is because each wallet.dat file is opened in the same BDB environment. The entire environment has a limited number of database locks, and it seems like 333 wallets hits that number of database locks.
The solution (which did not work) is to create a file named
DB_CONFIG in the data dir, and put the following lines in that file:
set_lk_max_locks 400000 set_lk_max_objects 400000
By default it is 40000 and now 400000 (ten times more locks available)
But this gave the same results.
I tried also:
With no luck.
I verified this on two different machines with 0.15.1 and 0.16.0. Same result. It always crashes when loading the 333 wallet.
Anyone have a solution to this?
I have put the list of wallets if anyone care to reproduce: https://pastebin.com/8wHD1tL3