Actual behavior
If you run a listunspent, fundrawtransaction, getwalletinfo (maybe other commands) on a big wallet (e.g. with wallet with at least 8000 transactions or more) all other operations conducted in parallel (e.g. getnewaddress) will be stuck until that command finishes.
Because of this issue when our wallet is sending transactions using listunspent and fundrawtransactions there is no way to get a new address via getnewaddress RPC call (as bitcoin waits for those calls to finish).
I’ve got bitcoin’s datadir and wallet both on NVME drives, but running listunspent and sometimes getwalletinfo is painfully slow.
The wallet itself is not that big and was created recently to migrate from bdb to the new descriptors wallet:
0$ du -sh .bitcoin/desc/
178M .bitcoin/desc/
0~$ ./bitcoin-cli -rpcwallet=desc getwalletinfo
1{
2 "walletname": "desc",
3 "walletversion": 169900,
4 "format": "sqlite",
5 "balance": xxx,
6 "unconfirmed_balance": xxx,
7 "immature_balance": 0.00000000,
8 "txcount": 8482,
9 "keypoolsize": 4000,
10 "keypoolsize_hd_internal": 4000,
11 "paytxfee": 0.00000000,
12 "private_keys_enabled": true,
13 "avoid_reuse": false,
14 "scanning": false,
15 "descriptors": true,
16 "external_signer": false
17}
0$ time ./bitcoin-cli -rpcwallet=desc listunspent|grep txid|wc -l
1224
2
3real 1m15.596s
4user 0m0.008s
5sys 0m0.000s
Expected behavior
listunspent or fundrawtransaction shouldn’t lock the wallet at least for getting new address, maybe other operations as well?
To reproduce
- create a new descriptors wallet and generate 17K addresses there
- create at least 8K transactions in and out
- try to run
listunspentorfundrawtransactionand in parallelgetnewaddress getnewaddresswill take 60 seconds or more to return an address until either oflistunspentorfundrawtransactionfinishes
System information
I’ve tried latest bitcoin release v24.0.1, master branch (built 77a36033b5ecbf8dedb917d680f4116786fd7375 commit) issue reproduces.
Self-built for Ubuntu 18.04 LTS.
I’ve got bitcoin’s datadir and wallet both on NVME drives, but running listunspent is painfully slow.