bitcoin/src/wallet
MarcoFalke 143bd108ed
Merge #19137: wallettool: Add dump and createfromdump commands
23cac24dd3 tests: Test bitcoin-wallet dump and createfromdump (Andrew Chow)
a88c320041 wallettool: Add createfromdump command (Andrew Chow)
e1e7a90d5f wallettool: Add dump command (Andrew Chow)

Pull request description:

  Adds two commands to the `bitcoin-wallet` tool: `dump` and `createfromdump`. These commands will be useful for a wallet storage migration in the future. It is also generally useful to have a storage agnostic dump like this. These commands are similar to BDB's `db_dump` and `db_load` tools. This can also be useful for manual construction of a wallet file for tests.

  `dump` outputs every key-value pair from the wallet as comma separated hex. Each key-value pair is on its own line with the key and value in hex separated by a comma. This is output to the file specified by the new `-dumpfile` option.

  `createfromdump` takes a file produced by `dump` and creates a new wallet file with exactly the records specified in that file.

  A new option `-dumpfile` is added to the wallet tool. When used with `dump`, the records will be written to the specified file. When used with `createfromdump`, the file is read and the key-value pairs constructed from it. `createfromdump` requires `-dumpfile`.

  A simple round-trip test is added to the `tool_wallet.py`.

  This PR is based on #19334,

ACKs for top commit:
  Sjors:
    re-utACK 23cac24
  MarcoFalke:
    re review ACK 23cac24dd3 only change is rebase and removing useless shared_ptr wrapper 🎼
  ryanofsky:
    Code review ACK 23cac24dd3. Only changes since last review rebase and changing a pointer to a reference

Tree-SHA512: 2d63cf62baca3d16495aa698dc02f7d889c81b41015e9c92c23c275bb4a690fc176d351c3fd7f310bd6b17f5a936cc9be694cbecd702af741b96c0f530e72fa2
2020-12-17 15:18:37 +01:00
..
test Merge #20575: Do not run functions with necessary side-effects in assert() 2020-12-16 23:14:53 +01:00
bdb.cpp refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
bdb.h refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04: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 Refactor OutputGroups to handle effective values, fees, and filtering 2020-08-11 14:25:02 -04:00
coinselection.h Refactor OutputGroups to handle effective values, fees, and filtering 2020-08-11 14:25:02 -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
crypter.h Convert wallet to new serialization 2020-05-24 10:34:52 -07:00
db.cpp wallet: List all wallets in non-SQLite or non-BDB builds 2020-12-04 11:03:28 -04:00
db.h refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
dump.cpp wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
dump.h wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
feebumper.cpp Remove unused and confusing CTransaction constructor 2020-12-07 14:59:33 +01:00
feebumper.h wallet: Avoid translating RPC errors when creating txs 2020-05-01 07:39:06 -04:00
fees.cpp
fees.h
init.cpp Do not compile BDB things when USE_BDB is defined 2020-11-18 11:56:08 -05:00
interfaces.cpp Merge #20275: wallet: List all wallets in non-SQLite and non-BDB builds 2020-12-12 09:20:11 +01:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp Ignoring (but warn) on duplicate -wallet parameters 2020-11-03 12:06:32 +01:00
load.h Do not create default wallet 2020-09-08 21:02:53 -04:00
rpcdump.cpp Merge #20153: wallet: do not import a descriptor with hardened derivations into a watch-only wallet 2020-11-09 20:19:00 +01:00
rpcwallet.cpp Merge #20275: wallet: List all wallets in non-SQLite and non-BDB builds 2020-12-12 09:20:11 +01:00
rpcwallet.h Assert that RPCArg names are equal to CRPCCommand ones (net, rpcwallet) 2020-09-22 20:49:30 +02:00
salvage.cpp refactor: Drop call to GetWalletEnv in wallet salvage code 2020-12-04 11:03:28 -04:00
salvage.h wallettool: Have RecoverDatabaseFile return errors and warnings 2020-07-26 20:22:45 -04:00
scriptpubkeyman.cpp Merge #20403: wallet: upgradewallet fixes, improvements, test coverage 2020-11-25 12:46:27 +01:00
scriptpubkeyman.h refactor: Improve use of explicit keyword 2020-12-01 18:36:39 +01:00
sqlite.cpp refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
sqlite.h refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
wallet.cpp Merge #20635: fix misleading comment about call to non-existing function 2020-12-17 15:06:01 +01:00
wallet.h Merge #19980: refactor: Some wallet cleanups 2020-12-02 08:23:00 +08:00
walletdb.cpp refactor: Consolidate redundant wallet database path and exists functions 2020-12-04 11:03:28 -04:00
walletdb.h Include wallet/bdb.h where it is actually being used 2020-11-18 11:55:43 -05:00
wallettool.cpp wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
wallettool.h wallet: Remove path checking code from bitcoin-wallet tool 2020-09-03 12:24:32 -04:00
walletutil.cpp MOVEONLY: Move IsBDBFile, IsSQLiteFile, and ListWalletDir 2020-12-04 11:03:28 -04:00
walletutil.h refactor: Replace ListWalletDir() function with ListDatabases() 2020-12-04 11:03:28 -04:00