fanquake e6acd9f72c
Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()s
6e77a7b65cda1b46ce42f0c99ca91562255aeb28 keypool: Add comment about TopUp and when to use it (Andrew Chow)
ea50e34b287e0da0806c1116bb55ade730e8ff6c keypool: Move opportunistic TopUps from LegacyScriptPubKeyMan to CWallet and ReserveDestination (Andrew Chow)
bb2c8ce23c9d7ba8d0e5538243e07218443c85b4 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 6e77a7b65cda1b46ce42f0c99ca91562255aeb28. Only the comment changed since my previous review.

Tree-SHA512: bdfc8d303842c3fb7c3d40af7abfa6d9dac4ef71a24922bb92229674ee89bfe3113ebb46d3903ac48ef99f0a7d6eaac33282495844f2b31f91b8df55084c421f
2019-12-17 12:01:18 -05:00
..
2019-10-15 22:56:43 +00:00
2019-01-26 12:45:48 -05:00
2019-10-15 22:56:43 +00:00
2019-12-16 19:43:15 -08:00
2019-10-30 16:24:02 -04:00
2018-12-29 10:15:01 +01:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-09-25 20:56:38 +02:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-02-22 17:38:45 -08:00
2019-02-22 17:38:45 -08:00
2019-12-11 18:51:16 +00:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-12-16 19:42:18 -08:00
2019-11-04 04:22:53 -05:00
2019-10-02 10:39:14 -04:00
2019-12-08 18:34:02 -08:00
2019-12-05 09:49:11 -08:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-09-25 10:56:00 -04:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00
2019-10-15 22:56:43 +00:00