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
fanquake e6acd9f72c
Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()s
6e77a7b65c keypool: Add comment about TopUp and when to use it (Andrew Chow)
ea50e34b28 keypool: Move opportunistic TopUps from LegacyScriptPubKeyMan to CWallet and ReserveDestination (Andrew Chow)
bb2c8ce23c keypool: Remove  superfluous topup from CWallet::GetNewChangeDestination (Andrew Chow)

Pull request description:

  * The `TopUp()` in `CWallet::GetNewChangeDestination` is unnecessary as currently m_spk_man calls TopUp further down the call stack inside LegacyScriptPubKeyMan::ReserveKeyFromKeyPool (called by LegacyScriptPubKeyMan::GetReservedDestination). This also lets us prepare for future changes with multiple ScriptPubKeyMans in the wallet.
  * An opportunistic `TopUp()` is moved from `LegacyScriptPubKeyMan::GetNewDestination` to `CWallet::GetNewDestination`.
  * Another opportunistic `TopUp()` is moved from `LegacyScriptPubKeyMan::ReserveKeyFromKeyPool`

  Moving opportunistic TopUps ensures that ScriptPubKeyMans will always be topped up before requesting Destinations from them as we cannot  always rely on future ScriptPubKeyMan implementaions topping up internally.

  See also: https://github.com/bitcoin/bitcoin/pull/17373#discussion_r348598174

ACKs for top commit:
  instagibbs:
    utACK 6e77a7b65c only change is slight elaboration on comment
  ryanofsky:
    Code review ACK 6e77a7b65c. Only the comment changed since my previous review.

Tree-SHA512: bdfc8d303842c3fb7c3d40af7abfa6d9dac4ef71a24922bb92229674ee89bfe3113ebb46d3903ac48ef99f0a7d6eaac33282495844f2b31f91b8df55084c421f
2019-12-17 12:01:18 -05:00
..
test Merge #17290: Enable BnB coin selection for preset inputs and subtract fee from outputs 2019-11-23 08:06:35 +13:00
coincontrol.cpp extract min & max depth onto coin control 2019-07-22 15:23:21 -04:00
coincontrol.h refactor: Nuke coincontrol circular dependency 2019-11-23 08:30:03 +02:00
coinselection.cpp refactor: Replace all uses of boost::optional with our own Optional type 2019-10-30 14:27:31 +01: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 Remove unused includes 2019-10-15 22:56:43 +00:00
db.cpp scripted-diff: Change BCLog::DB to BCLog::WALLETDB 2019-11-08 18:45:38 +01:00
db.h Merge #17070: wallet: Avoid showing GUI popups on RPC errors 2019-10-21 13:48:27 +02:00
feebumper.cpp Fix origfee return for bumpfee with feerate arg 2019-12-01 20:54:16 -05:00
feebumper.h change wallet pointers to references in feebumper 2019-10-10 17:46:59 -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 refactor: Nuke coincontrol circular dependency 2019-11-23 08:30:03 +02:00
ismine.h Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes 2019-10-25 19:20:24 -04:00
load.cpp wallet: Avoid showing GUI popups on RPC errors 2019-10-08 13:02:14 -04:00
load.h wallet: Fix documentation around WalletParameterInteraction 2019-09-03 14:10:25 -04:00
psbtwallet.cpp Refactor: Require scriptPubKey to get wallet SigningProvider 2019-11-18 15:42:01 -05:00
psbtwallet.h Remove unused includes 2019-10-15 22:56:43 +00:00
rpcdump.cpp qa: unify unix epoch time descriptions 2019-12-13 02:02:29 +01:00
rpcwallet.cpp qa: unify unix epoch time descriptions 2019-12-13 02:02:29 +01:00
rpcwallet.h Add EnsureLegacyScriptPubKeyMan and use in rpcwallet.cpp 2019-11-05 10:13:43 -05:00
scriptpubkeyman.cpp Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()s 2019-12-17 12:01:18 -05:00
scriptpubkeyman.h Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()s 2019-12-17 12:01:18 -05:00
wallet.cpp Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()s 2019-12-17 12:01:18 -05:00
wallet.h Remove SetCrypted() and fUseCrypto; Change IsCrypted()'s implementation 2019-12-06 15:05:48 -05:00
walletdb.cpp scripted-diff: Change BCLog::DB to BCLog::WALLETDB 2019-11-08 18:45:38 +01:00
walletdb.h Merge #17070: wallet: Avoid showing GUI popups on RPC errors 2019-10-21 13:48:27 +02:00
wallettool.cpp Merge #17260: Split some CWallet functions into new LegacyScriptPubKeyMan 2019-10-29 08:19:23 -04:00
wallettool.h Remove unused includes 2019-10-15 22:56:43 +00:00
walletutil.cpp Merge #15870: wallet: Only fail rescan when blocks have actually been pruned 2019-05-16 11:18:27 -04:00
walletutil.h Move wallet enums to walletutil.h 2019-10-25 19:20:24 -04:00