elements/src/wallet
MarcoFalke 10358a381a
Merge #17737: Add ChainstateManager, remove BlockManager global
c9017ce3bc protect g_chainman with cs_main (James O'Beirne)
2b081c4568 test: add basic tests for ChainstateManager (James O'Beirne)
4ae29f5f0c use ChainstateManager to initialize chainstate (James O'Beirne)
5b690f0aae refactor: move RewindBlockIndex to CChainState (James O'Beirne)
89cdf4d569 validation: introduce unused ChainstateManager (James O'Beirne)
8e2ecfe249 validation: add CChainState.m_from_snapshot_blockhash (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: #15606
  Issue: #15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  This changeset introduces `ChainstateManager`, which is responsible for creating and managing access to multiple chainstates. Until we allow chainstate creation from UTXO snapshots (next assumeutxo PR?) it's basically unnecessary, but it is a prerequisite for background IBD support.

  Changes are also made to the initialization process to make use of `g_chainman` and thus clear the way for multiple chainstates being loaded on startup.

  One immediate benefit of this change is that we no longer have the `g_blockman` global, but instead have the ChainstateManager inject a reference of its shared BlockManager into any chainstate it creates.

  Another immediate benefit is that uses of `ChainActive()` and `ChainstateActive()` are now covered by lock annotations. Because use of `g_chainman` is annotated to require cs_main, these two functions subsequently follow.

  Because of whitespace changes, this diff looks bigger than it is. E.g., 4813167d98 is most easily reviewed with
  ```sh
  git show --color-moved=dimmed_zebra -w 4813167d98
  ```

ACKs for top commit:
  MarcoFalke:
    re-ACK c9017ce3bc 📙
  fjahr:
    Code Review Re-ACK c9017ce3bc
  ariard:
    Code Review ACK c9017ce
  ryanofsky:
    Code review ACK c9017ce3bc. No changes since last review other than a straight rebase

Tree-SHA512: 3f250d0dc95d4bfd70852ef1e39e081a4a9b71a4453f276e6d474c2ae06ad6ae6a32b4173084fe499e1e9af72dd9007f4a8a375c63ce9ac472ffeaada41ab508
2020-04-10 13:02:01 -04:00
..
test Merge #17737: Add ChainstateManager, remove BlockManager global 2020-04-10 13:02:01 -04: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 wallet: Handle duplicate fileid exception 2020-03-31 14:23:43 +01:00
load.h wallet: Fix documentation around WalletParameterInteraction 2019-09-03 14:10:25 -04:00
rpcdump.cpp Wallet: Replace CAddressBookData.name with GetLabel() method 2020-04-06 20:52:04 +00:00
rpcwallet.cpp Merge #18504: build: Drop bitcoin-tx and bitcoin-wallet dependencies on libevent 2020-04-10 12:52:37 -04:00
rpcwallet.h rpc: Make rpc documentation not depend on rpc args 2020-04-02 00:25:13 +08: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 Wallet: Change IsMine check in CWallet::DelAddressBook from assert to failure 2020-04-06 20:52:04 +00:00
wallet.h Wallet: Replace CAddressBookData.name with GetLabel() method 2020-04-06 20:52:04 +00:00
walletdb.cpp Wallet: Require usage of new CAddressBookData::setLabel to change label 2020-04-02 16:01:36 +00:00
walletdb.h Fix doxygen errors 2020-01-16 18:25:11 -08:00
wallettool.cpp scripted-diff: Wallet: Rename mapAddressBook to m_address_book 2020-04-02 16:00:28 +00: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