mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #18241: wallet/refactor: refer to CWallet immutably when possible
79facb11e9wallet: use constant CWallets in rpcwallet.cpp (Karl-Johan Alm)d9b0ebc1dawallet: make ReserveDestination pwallet ivar const (Karl-Johan Alm)57c569e4d9wallet: make BackupWallet() const (Karl-Johan Alm)df3a818d2awallet: make getters const (Karl-Johan Alm)227b9dd2d6wallet/spkm: make GetOldestKeyPoolTime() const (Karl-Johan Alm)22d329ad0ewallet: use constant CWallets in rpcdump.cpp (Karl-Johan Alm)7b3587b29dwallet/db: make IsDummy() const (Karl-Johan Alm)d366795d18wallet/db: make Backup() const (Karl-Johan Alm)8cd0b86340wallet: make CanGetAddresses() const (Karl-Johan Alm)037fa770ebwallet: make KeypoolCountExternalKeys() const (Karl-Johan Alm)ddc93557adwallet: make CanGenerateKeys() const (Karl-Johan Alm)dc2d0650fdmake 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: ACK79facb11e9Empact: ACK79facb11e9promag: ACK79facb11e9. fjahr: ACK79facb11e9Tree-SHA512: 80a80c1a52f0f788d0ccb268b53bc0f46c796643a3c5a22b55bbbde4ffa6c7e347784e5e53b1e488a3b4e14399e31d5be9417ad5b6319c74a462609e9b1a98e8
This commit is contained in:
@@ -850,7 +850,7 @@ bool BerkeleyDatabase::Rewrite(const char* pszSkip)
|
||||
return BerkeleyBatch::Rewrite(*this, pszSkip);
|
||||
}
|
||||
|
||||
bool BerkeleyDatabase::Backup(const std::string& strDest)
|
||||
bool BerkeleyDatabase::Backup(const std::string& strDest) const
|
||||
{
|
||||
if (IsDummy()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user