bitcoin/src/wallet
MarcoFalke 5c3c7cc50c
Merge #19300: wallet: Handle concurrent wallet loading
9b009fae6e qa: Test concurrent wallet loading (João Barbosa)
b9971ae585 wallet: Handle concurrent wallet loading (João Barbosa)

Pull request description:

  This PR handles concurrent wallet loading.

  This can be tested by running in parallel the following script a couple of times:
  ```sh
  for i in {1..10}
  do
    src/bitcoin-cli -regtest loadwallet foo
    src/bitcoin-cli -regtest unloadwallet foo
  done
  ```

  Eventually the error occurs:
  ```
  error code: -4
  error message:
  Wallet already being loading.
  ```

  For reference, loading and already loaded wallet gives:
  ```
  error code: -4
  error message:
  Wallet file verification failed. Error loading wallet w1. Duplicate -wallet filename specified.
  ```

  Fixes #19232.

ACKs for top commit:
  MarcoFalke:
    Concept ACK 9b009fae6e I have not reviewed the code
  hebasto:
    ACK 9b009fae6e, tested on Linux Mint 20 (x86_64):
  ryanofsky:
    Code review good-but-not-ideal ACK 9b009fae6e

Tree-SHA512: 0ccd77b03c0926e4c4e51efb31e193b93cb4b9ffe8bac6bb018f7344c55dfd939b873b8cf5e657dca73e6202eb75aa672de2acb787cc133184b0b3b51e47b972
2020-06-29 11:14:26 -04:00
..
test refactor: Replace HexStr(o.begin(), o.end()) with HexStr(o) 2020-06-24 18:41:45 +02:00
bdb.cpp walletdb: refactor Read, Write, Erase, and Exists into non-template func 2020-06-17 10:29:27 -04:00
bdb.h Merge #19310: wallet: BerkeleyDatabase make BerkeleyDatabase::Create, CreateMock, and CreateDummy non-static functions 2020-06-18 16:29:21 -04:00
coincontrol.cpp [rpc] walletcreatefundedpsbt: don't automatically append inputs 2020-03-12 13:07:17 +01:00
coincontrol.h [rpc] walletcreatefundedpsbt: don't automatically append inputs 2020-03-12 13:07:17 +01:00
coinselection.cpp bnb: exit selection when best_waste is 0 2020-03-04 16:35:15 -05:00
coinselection.h amount: Move CAmount CENT to unit test header 2018-09-17 14:34:56 -04:00
context.cpp Remove g_rpc_chain global 2020-05-28 02:13:19 -04:00
context.h Remove g_rpc_chain global 2020-05-28 02:13:19 -04:00
crypter.cpp Fix occurences of c_str() used with size() to data() 2019-10-28 13:41:45 +01:00
crypter.h Convert wallet to new serialization 2020-05-24 10:34:52 -07:00
db.cpp walletdb: Move BDB specific things into bdb.{cpp/h} 2020-06-15 20:41:05 -04:00
db.h walletdb: Move BDB specific things into bdb.{cpp/h} 2020-06-15 20:41:05 -04:00
feebumper.cpp wallet: Remove trailing whitespace from potential translation strings 2020-05-01 07:41:32 -04:00
feebumper.h wallet: Avoid translating RPC errors when creating txs 2020-05-01 07:39:06 -04:00
fees.cpp Remove unused includes 2019-10-15 22:56:43 +00:00
fees.h Remove uses of fee globals in wallet code 2019-02-22 15:43:02 -04:00
init.cpp wallet: remove -salvagewallet 2020-05-25 12:39:40 -04:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp wallet: remove -salvagewallet 2020-05-25 12:39:40 -04:00
load.h wallet: remove -salvagewallet 2020-05-25 12:39:40 -04:00
rpcdump.cpp Merge #19114: scripted-diff: TxoutType C++11 scoped enum class 2020-06-28 14:20:00 -04:00
rpcwallet.cpp Merge #19114: scripted-diff: TxoutType C++11 scoped enum class 2020-06-28 14:20:00 -04:00
rpcwallet.h refactor: Combine GetWalletForJSONRPCRequest and EnsureWalletIsAvailable functions 2020-06-05 08:29:18 -04:00
salvage.cpp scripted-diff: Replace WalletDatabase::Create* with CreateWalletDatabase 2020-06-17 14:12:41 -04:00
salvage.h Move RecoverKeysOnlyFilter into RecoverDataBaseFile 2020-05-25 12:59:29 -04:00
scriptpubkeyman.cpp Merge #19114: scripted-diff: TxoutType C++11 scoped enum class 2020-06-28 14:20:00 -04:00
scriptpubkeyman.h FillPSBT: report number of inputs signed (or would sign) 2020-06-18 23:32:59 -07:00
wallet.cpp Merge #19300: wallet: Handle concurrent wallet loading 2020-06-29 11:14:26 -04:00
wallet.h FillPSBT: report number of inputs signed (or would sign) 2020-06-18 23:32:59 -07:00
walletdb.cpp Merge #19054: wallet: Skip hdKeypath of 'm' when determining inactive hd seeds 2020-06-19 16:14:47 -04:00
walletdb.h Add Create*WalletDatabase functions 2020-06-17 12:31:29 -04:00
wallettool.cpp scripted-diff: Replace WalletDatabase::Create* with CreateWalletDatabase 2020-06-17 14:12:41 -04:00
wallettool.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
walletutil.cpp Correctly check for default wallet 2020-04-23 13:59:48 -04:00
walletutil.h Convert wallet to new serialization 2020-05-24 10:34:52 -07:00