0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-05 10:17:30 -05:00
bitcoin-bitcoin-core/src/wallet
Wladimir J. van der Laan 9a2b5f22c1
Merge #18338: Fix wallet unload race condition
41b0baf43c gui: Handle WalletModel::unload asynchronous (João Barbosa)
ab31b9d6fe Fix wallet unload race condition (Russell Yanofsky)

Pull request description:

  This PR consists in two fixes. The first fixes a concurrency issues with `boost::signals2`. The second fixes a wallet model destruction while it's being used.

  From boost signal documentation at https://www.boost.org/doc/libs/1_72_0/doc/html/signals2/thread-safety.html:

  > When a signal is invoked by calling signal::operator(), the invocation first acquires a lock on the signal's mutex. Then it obtains a handle to the signal's slot list and combiner. Next it releases the signal's mutex, before invoking the combiner to iterate through the slot list.

  This means that `UnregisterValidationInterface` doesn't prevent more calls to that interface. The fix consists in capturing the `shared_ptr<CValidationInterface>` in each internal slot.

  The GUI bug is fixed by using a `Qt::QueuedConnection` in the `WalletModel::unload` connection.

ACKs for top commit:
  ryanofsky:
    Code review ACK 41b0baf43c. Only change is moving assert as suggested
  hebasto:
    ACK 41b0baf43c, tested on Linux Mint 19.3.

Tree-SHA512: 4f712d8de65bc1214411831250de5dc0a9fd505fb84da5baf9f2cc4d551bc3abffc061616f00afe43dba7525af2cd96c9b54aeead9383145e3b8801f25d85f50
2020-03-31 15:07:06 +02:00
..
test Fix wallet unload race condition 2020-03-27 15:17:35 +00:00
coincontrol.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
coincontrol.h refactor: Nuke coincontrol circular dependency 2019-11-23 08:30:03 +02:00
coinselection.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
coinselection.h amount: Move CAmount CENT to unit test header 2018-09-17 14:34:56 -04:00
crypter.cpp Fix occurences of c_str() used with size() to data() 2019-10-28 13:41:45 +01:00
crypter.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
db.cpp Merge #18241: wallet/refactor: refer to CWallet immutably when possible 2020-03-07 07:24:54 +08:00
db.h wallet/db: make IsDummy() const 2020-03-02 17:26:30 +09:00
feebumper.cpp wallet: remove CreateTotalBumpTransaction() 2020-03-26 17:54:23 +01:00
feebumper.h wallet: remove CreateTotalBumpTransaction() 2020-03-26 17:54:23 +01: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 Merge #13339: wallet: Replace %w by wallet name in -walletnotify script 2020-02-17 11:59:23 +01:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp scheduler: Make schedule* methods type safe 2020-03-10 09:47:32 -04:00
load.h wallet: Fix documentation around WalletParameterInteraction 2019-09-03 14:10:25 -04:00
rpcdump.cpp rpc: Document an RPCResult for all calls; Enforce at compile time 2020-03-13 15:36:15 -04:00
rpcwallet.cpp rpc: remove unused getbalances() code 2020-03-28 20:25:53 +01:00
rpcwallet.h Refactor: Allow LegacyScriptPubKeyMan to be null 2020-01-23 16:34:28 -05:00
scriptpubkeyman.cpp Replace std::to_string with locale-independent alternative 2020-03-14 12:23:01 -07:00
scriptpubkeyman.h Replace GetSigningProvider with GetSolvingProvider 2020-03-09 11:16:20 -04:00
wallet.cpp Fix wallet unload race condition 2020-03-27 15:17:35 +00:00
wallet.h Merge #18338: Fix wallet unload race condition 2020-03-31 15:07:06 +02:00
walletdb.cpp Refactor: Allow LegacyScriptPubKeyMan to be null 2020-01-23 16:34:28 -05:00
walletdb.h Fix doxygen errors 2020-01-16 18:25:11 -08:00
wallettool.cpp Refactor: Allow LegacyScriptPubKeyMan to be null 2020-01-23 16:34:28 -05:00
wallettool.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
walletutil.cpp Merge #15870: wallet: Only fail rescan when blocks have actually been pruned 2019-05-16 11:18:27 -04:00
walletutil.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00