bitcoin/src/wallet
Russell Yanofsky c7bd5842e4 MOVEONLY: CWallet transaction code out of wallet.cpp/.h
This commit just moves functions without making any changes. It can be
reviewed with `git log -p -n1 --color-moved=dimmed_zebra`

Motivation for this change is to make wallet.cpp/h less monolithic and
start to make wallet transaction state tracking comprehensible so bugs
in
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking
can be fixed safely without introducing new problems.

This commit moves wallet classes and methods that deal with transactions
out of wallet.cpp/.h into better organized files:

- transaction.cpp/.h - CWalletTx and CMerkleTx class definitions
- receive.cpp/.h - functions checking received transactions and computing balances
- spend.cpp/.h - functions creating transactions and finding spendable coins

After #20773, when loading is separated from syncing it will also be
possible to move more wallet.cpp/.h functions to:

- sync.cpp/.h - functions handling chain notifications and rescanning

This commit arranges receive.cpp and spend.cpp functions in dependency
order so it's possible to skim receive.cpp and get an idea of how
computing balances works, and skim spend.cpp and get an idea of how
transactions are created, without having to jump all over wallet.cpp
where functions are not in order and there is a lot of unrelated code.

Followup commit "refactor: Detach wallet transaction methods" in
https://github.com/bitcoin/bitcoin/pull/21206 follows up this PR and
tweaks function names and arguments to reflect new locations. The two
commits are split into separate PRs because this commit is more work to
maintain and less work to review, while the other commit is less work to
maintain and more work to review, so hopefully this commit can be merged
earlier.
2021-05-26 06:32:51 -05:00
..
test Merge bitcoin/bitcoin#17331: Use effective values throughout coin selection 2021-05-26 01:35:43 +12:00
bdb.cpp scripted-diff: remove MakeUnique<T>() 2021-03-11 13:45:14 +08:00
bdb.h wallet: Add BerkeleyDB version sanity check at init time 2021-01-17 18:10:20 +01:00
coincontrol.cpp refactor: Drop CCoinControl::SetNull 2021-04-18 21:10:47 +01:00
coincontrol.h rpc: include_unsafe option for fundrawtransaction 2021-04-30 18:53:47 +02:00
coinselection.cpp Have OutputGroup determine the value to use 2021-05-19 15:35:11 -04:00
coinselection.h Have OutputGroup determine the value to use 2021-05-19 15:35:11 -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 refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
crypter.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
db.cpp wallet: Do not iterate a directory if having an error while accessing it 2021-05-12 12:11:47 +03:00
db.h refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
dump.cpp refactor: move first run detection to client code 2021-05-19 08:50:16 +02:00
dump.h wallettool: Add createfromdump command 2020-12-16 12:33:06 -05:00
external_signer_scriptpubkeyman.cpp refactor: add missing includes to external signer code 2021-04-13 20:09:33 +08:00
external_signer_scriptpubkeyman.h refactor: add missing includes to external signer code 2021-04-13 20:09:33 +08:00
feebumper.cpp Replace size/weight estimate tuple with struct for named fields 2021-05-26 07:33:09 +08:00
feebumper.h wallet: Avoid translating RPC errors when creating txs 2020-05-01 07:39:06 -04:00
fees.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
fees.h Remove uses of fee globals in wallet code 2019-02-22 15:43:02 -04:00
init.cpp Merge bitcoin/bitcoin#18418: wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 2021-05-26 19:32:51 +08:00
interfaces.cpp Move external signer out of wallet module 2021-04-08 17:56:00 +02:00
ismine.h doc: Add developer documentation to isminetype 2021-01-19 19:04:45 +08:00
load.cpp wallet: make chain optional for CWallet::Create 2021-05-19 08:50:20 +02:00
load.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
receive.cpp MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
receive.h MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
rpcdump.cpp Merge bitcoin/bitcoin#21836: scripted-diff: Replace three dots with ellipsis in the UI strings 2021-05-10 14:02:46 +02:00
rpcwallet.cpp Merge bitcoin/bitcoin#18418: wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 2021-05-26 19:32:51 +08:00
rpcwallet.h refactor: replace util::Ref by std::any (C++17) 2021-03-29 23:29:42 +02:00
salvage.cpp refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
salvage.h wallettool: Have RecoverDatabaseFile return errors and warnings 2020-07-26 20:22:45 -04:00
scriptpubkeyman.cpp refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
scriptpubkeyman.h wallet: ExternalSigner: add GetDescriptors method 2021-02-23 14:34:31 +01:00
spend.cpp MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
spend.h MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
sqlite.cpp wallet: refactor: dedup sqlite PRAGMA assignments 2021-05-17 17:22:36 +02:00
sqlite.h doc: fix various typos 2021-01-04 12:31:31 +08:00
transaction.cpp MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
transaction.h MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
wallet.cpp MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
wallet.h MOVEONLY: CWallet transaction code out of wallet.cpp/.h 2021-05-26 06:32:51 -05:00
walletdb.cpp refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
walletdb.h Include wallet/bdb.h where it is actually being used 2020-11-18 11:55:43 -05:00
wallettool.cpp refactor: move first run detection to client code 2021-05-19 08:50:16 +02:00
wallettool.h refactor: Move all command dependend checks to ExecuteWalletToolFunc 2021-01-21 19:30:34 +01:00
walletutil.cpp scripted-diff: Replace GetDataDir() calls with gArgs.GetDataDirNet() calls 2021-05-24 10:29:58 +02:00
walletutil.h wallet: add external_signer flag 2021-02-23 14:34:30 +01:00