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
fanquake 4d80274b99
Merge #18241: wallet/refactor: refer to CWallet immutably when possible
79facb11e9 wallet: use constant CWallets in rpcwallet.cpp (Karl-Johan Alm)
d9b0ebc1da wallet: make ReserveDestination pwallet ivar const (Karl-Johan Alm)
57c569e4d9 wallet: make BackupWallet() const (Karl-Johan Alm)
df3a818d2a wallet: make getters const (Karl-Johan Alm)
227b9dd2d6 wallet/spkm: make GetOldestKeyPoolTime() const (Karl-Johan Alm)
22d329ad0e wallet: use constant CWallets in rpcdump.cpp (Karl-Johan Alm)
7b3587b29d wallet/db: make IsDummy() const (Karl-Johan Alm)
d366795d18 wallet/db: make Backup() const (Karl-Johan Alm)
8cd0b86340 wallet: make CanGetAddresses() const (Karl-Johan Alm)
037fa770eb wallet: make KeypoolCountExternalKeys() const (Karl-Johan Alm)
ddc93557ad wallet: make CanGenerateKeys() const (Karl-Johan Alm)
dc2d0650fd make BlockUntilSyncedToCurrentChain() const (Karl-Johan Alm)

Pull request description:

  A lot of places refer to `CWallet*`'s as `CWallet * const`, which translates to *"an immutable pointer to a mutable `CWallet` instance"*; this is

  1. often not what the author meant, especially as a lot of these places do not at all modify the wallet object, and
  2. confusing, as it tends to suggest that this is a proper way to refer to a constant `CWallet` instance.

  This PR changes references to wallets to `const CWallet* const` whenever immutability is expected. This should result in no behavioral changes at all, and improved compile-time error checking.

  Note from irc:

  > <sipa> sounds good to me; this is the sort of change that as long as it compiles, the behavior shouldn't change
  > <sipa> though in general it may lead to introducing automatic copying of objects sometimes (e.g. trying to std::move a const object will work, but generally result in a copy rather than an efficient move)
  > <sipa> CWallet objects aren't copied or moved though

ACKs for top commit:
  laanwj:
    ACK 79facb11e9
  Empact:
    ACK 79facb11e9
  promag:
    ACK 79facb11e9.
  fjahr:
    ACK 79facb11e9

Tree-SHA512: 80a80c1a52f0f788d0ccb268b53bc0f46c796643a3c5a22b55bbbde4ffa6c7e347784e5e53b1e488a3b4e14399e31d5be9417ad5b6319c74a462609e9b1a98e8
2020-03-07 07:24:54 +08:00
..
test test: Add cost_of_change parameter assertions to bnb_search_test 2020-02-22 11:11:09 -06: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 Refactor FormatStateMessage into ValidationState 2020-02-27 17:59:07 -08:00
feebumper.h change wallet pointers to references in feebumper 2019-10-10 17:46:59 -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 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: Avoid showing GUI popups on RPC errors 2019-10-08 13:02:14 -04:00
load.h wallet: Fix documentation around WalletParameterInteraction 2019-09-03 14:10:25 -04:00
psbtwallet.cpp Merge #17261: Make ScriptPubKeyMan an actual interface and the wallet to have multiple 2020-01-30 17:21:21 +13:00
psbtwallet.h Merge #17264: rpc: set default bip32derivs to true for psbt methods 2020-02-25 23:50:39 +13:00
rpcdump.cpp Merge #18241: wallet/refactor: refer to CWallet immutably when possible 2020-03-07 07:24:54 +08:00
rpcwallet.cpp Merge #18241: wallet/refactor: refer to CWallet immutably when possible 2020-03-07 07:24:54 +08:00
rpcwallet.h Refactor: Allow LegacyScriptPubKeyMan to be null 2020-01-23 16:34:28 -05:00
scriptpubkeyman.cpp wallet/spkm: make GetOldestKeyPoolTime() const 2020-03-02 17:26:31 +09:00
scriptpubkeyman.h wallet/spkm: make GetOldestKeyPoolTime() const 2020-03-02 17:26:31 +09:00
wallet.cpp wallet: make BackupWallet() const 2020-03-02 17:27:35 +09:00
wallet.h wallet: make ReserveDestination pwallet ivar const 2020-03-02 17:27:35 +09: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