bitcoin/src/wallet
Samuel Dobson 9d4b3d86b6
Merge #19334: wallet: Introduce WalletDatabase abstract class
d416ae560e walletdb: Introduce WalletDatabase abstract class (Andrew Chow)
2179dbcbcd walletdb: Add BerkeleyDatabase::Open dummy function (Andrew Chow)
71d28e7cdc walletdb: Introduce AddRef and RemoveRef functions (Andrew Chow)
27b2766384 walletdb: Move BerkeleyDatabase::Flush(true) to Close() (Andrew Chow)

Pull request description:

  A `WalletDatabase` abstract class is created from `BerkeleyDatabase` and is implemented by `BerkeleyDatabase`. First, to get to the point that this is possible, 4 functions need to be added to `BerkeleyDatabase`: `AddRef`, `RemoveRef`, `Open`, and `Close`.

  First the increment and decrement of `mapFileUseCount` is refactored into separate functions `AddRef` and `RemoveRef`.

  `Open` is introduced as a dummy function. This will raise an exception so that it always fails.

  `Close` is refactored from `Flush`. The `shutdown` argument in `Flush` is removed and instead `Flush(true)` is now the `Close` function.

  Split from #18971

  Requires #19325

ACKs for top commit:
  ryanofsky:
    Code review ACK d416ae560e. Only changes since last review were rebasing after base PR #19334 merge, and adding cs_db lock in BerkeleyDatabase destructor, which should avoid races accessing env->m_databases and env->m_fileids
  fjahr:
    Code review ACK d416ae560e
  meshcollider:
    Code review & test run ACK d416ae560e

Tree-SHA512: 98d05ec093d7446c4488e2b0914584222a331e9a2f4d5be6af98e3f6d78fdd8e75526c12f91a8a52d4820c25bce02aa02aabe92d38bee7eb2fce07d0691b7b0d
2020-07-23 15:22:25 +12:00
..
test Merge #19370: Static asserts for consistency of fee defaults 2020-07-22 19:25:07 +02:00
bdb.cpp Merge #19334: wallet: Introduce WalletDatabase abstract class 2020-07-23 15:22:25 +12:00
bdb.h Merge #19334: wallet: Introduce WalletDatabase abstract class 2020-07-23 15:22:25 +12: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 wallet: Pass unused args to StartWallets 2020-07-09 13:07:37 +02: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: Introduce WalletDatabase abstract class 2020-07-14 11:07:16 -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: Pass unused args to StartWallets 2020-07-09 13:07:37 +02:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -04:00
load.h wallet: Pass unused args to StartWallets 2020-07-09 13:07:37 +02:00
rpcdump.cpp Merge #19046: Replace CWallet::Set* functions that use memonly with Add/Load variants 2020-07-11 23:08:54 +12:00
rpcwallet.cpp Merge #18202: refactor: consolidate sendmany and sendtoaddress code 2020-07-12 14:42:35 +12:00
rpcwallet.h refactor: Combine GetWalletForJSONRPCRequest and EnsureWalletIsAvailable functions 2020-06-05 08:29:18 -04:00
salvage.cpp walletdb: Don't remove database transaction logs and instead error 2020-07-13 11:00:54 -04:00
salvage.h Move RecoverKeysOnlyFilter into RecoverDataBaseFile 2020-05-25 12:59:29 -04:00
scriptpubkeyman.cpp Merge #19046: Replace CWallet::Set* functions that use memonly with Add/Load variants 2020-07-11 23:08:54 +12:00
scriptpubkeyman.h Merge #19046: Replace CWallet::Set* functions that use memonly with Add/Load variants 2020-07-11 23:08:54 +12:00
wallet.cpp walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -04:00
wallet.h walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -04:00
walletdb.cpp walletdb: Introduce WalletDatabase abstract class 2020-07-14 11:07:16 -04:00
walletdb.h walletdb: Introduce WalletDatabase abstract class 2020-07-14 11:07:16 -04:00
wallettool.cpp walletdb: Move BerkeleyDatabase::Flush(true) to Close() 2020-07-14 11:07:16 -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