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
Samuel Dobson 60091d20f9
Merge #9381: Remove CWalletTx merging logic from AddToWallet
28b112e9bd Get rid of BindWallet (Russell Yanofsky)
d002f9d15d Disable CWalletTx copy constructor (Russell Yanofsky)
65b9d8f8dd Avoid copying CWalletTx in LoadToWallet (Russell Yanofsky)
bd2fbc7cdb Get rid of unneeded CWalletTx::Init parameter (Russell Yanofsky)
2b9cba2065 Remove CWalletTx merging logic from AddToWallet (Russell Yanofsky)

Pull request description:

  This is a pure refactoring, no behavior is changing.

  Instead of AddToWallet taking a temporary CWalletTx object and then potentially merging it with a pre-existing CWalletTx, have it take a callback so callers can update the pre-existing CWalletTx directly.

  This makes AddToWallet simpler because now it is only has to be concerned with saving CWalletTx objects and not merging them.

  This makes AddToWallet calls clearer because they can now make direct updates to CWalletTx entries without having to make temporary objects and then worry about how they will be merged.

  Motivation for this change came from the bumpfee PR #8456 where we wanted to be able to call AddToWallet to make a simple update to an existing transaction, but were reluctant to, because the existing CWalletTx merging logic did not apply and seemed dangerous try to update as part of that PR. After this refactoring, the bumpfee PR could call AddToWallet safely instead of implementing a duplicate AddToWallet function.

  This also allows getting rid of the CWalletTx copy constructor to prevent unintentional copying.

ACKs for top commit:
  MarcoFalke:
    Anyway, re-ACK 28b112e9bd

Tree-SHA512: 528dd088714472a237500b200f4433db850bdb7fc29c5e5d81cae48072061dfb967f7c37edd90b33f24901239f9be982988547c1f8c80abc25fb243fbf7330ef
2020-05-06 11:36:32 +12:00
..
test Merge #9381: Remove CWalletTx merging logic from AddToWallet 2020-05-06 11:36:32 +12: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 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
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 wallet: Avoid translating RPC errors when loading wallets 2020-05-01 07:39:00 -04:00
db.h wallet: Avoid translating RPC errors when loading wallets 2020-05-01 07:39:00 -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 Merge #15761: Replace -upgradewallet startup option with upgradewallet RPC 2020-04-19 07:06:42 -04:00
ismine.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
load.cpp wallet: Avoid translating RPC errors when loading wallets 2020-05-01 07:39:00 -04:00
load.h wallet: Fix documentation around WalletParameterInteraction 2019-09-03 14:10:25 -04:00
rpcdump.cpp Remove CWalletTx merging logic from AddToWallet 2020-05-01 05:59:09 -05:00
rpcwallet.cpp Merge #9381: Remove CWalletTx merging logic from AddToWallet 2020-05-06 11:36:32 +12:00
rpcwallet.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
scriptpubkeyman.cpp wallet: Avoid translating RPC errors when loading wallets 2020-05-01 07:39:00 -04:00
scriptpubkeyman.h Merge #18782: wallet: Make sure no DescriptorScriptPubKeyMan or WalletDescriptor members are left uninitialized after construction 2020-05-05 15:56:04 +12:00
wallet.cpp Merge #9381: Remove CWalletTx merging logic from AddToWallet 2020-05-06 11:36:32 +12:00
wallet.h Merge #9381: Remove CWalletTx merging logic from AddToWallet 2020-05-06 11:36:32 +12:00
walletdb.cpp Merge #9381: Remove CWalletTx merging logic from AddToWallet 2020-05-06 11:36:32 +12:00
walletdb.h Merge #9381: Remove CWalletTx merging logic from AddToWallet 2020-05-06 11:36:32 +12:00
wallettool.cpp wallet: Report full error message in wallettool 2020-05-01 07:39:35 -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 wallet: Make sure no WalletDescriptor members are uninitialized after construction 2020-04-27 14:20:26 +00:00