elements/src/wallet
fanquake 4ee8a58ce7
Merge #17373: wallet: Various fixes and cleanup to keypool handling in LegacyScriptPubKeyMan and CWallet
886f1731be Key pool: Fix omitted pre-split count in GetKeyPoolSize (Andrew Chow)
386a994b85 Key pool: Change ReturnDestination interface to take address instead of key (Andrew Chow)
ba41aa4969 Key pool: Move LearnRelated and GetDestination calls (Andrew Chow)
65833a7407 Add OutputType and CPubKey parameters to KeepDestination (Andrew Chow)
9fcf8ce7ae Rename Keep/ReturnKey to Keep/ReturnDestination and remove the wrapper (Andrew Chow)
596f6460f9 Key pool: Move CanGetAddresses call (Andrew Chow)

Pull request description:

  * The `pwallet->CanGetAddresses()` call in `ReserveDestination::GetReservedDestination` to `LegacyScriptPubKeyMan::GetReservedDestination` so that the sanity check results in a failure when a `ScriptPubKeyMan` individually cannot get a destination, not when any of the `ScriptPubKeyMan`s can't.
  * `ScriptPubKeyMan::GetReservedDestination` is changed to return the destination so that future `ScriptPubKeyMan`s can return destinations constructed in other ways. This is implemented for `LegacyScriptPubKeyMan` by moving key-to-destination code from `CWallet` to `LegacyScriptPubKeyMan`
  * In order for `ScriptPubKeyMan` to be generic and work with future `ScriptPubKeyMan`s, `ScriptPubKeyMan::ReturnDestination` is changed to take a `CTxDestination` instead of a `CPubKey`. Since `LegacyScriptPubKeyMan` still deals with keys internally, a new map `m_reserved_key_to_index` is added in order to track the keypool indexes that have been reserved.
  * A bug is fixed in how the total keypool size is calculated as it was omitting `set_pre_split_keypool` which is a bug.

  Split from #17261

ACKs for top commit:
  ryanofsky:
    Code review ACK 886f1731be. Only change is moving earlier fix to a better commit (same end result).
  promag:
    Code review ACK 886f1731be.
  instagibbs:
    code review re-ACK https://github.com/bitcoin/bitcoin/pull/17373/commits/886f1731bec4393dd342403ac34069a3a4f95eea
  Sjors:
    Code review re-ACK 886f1731be

Tree-SHA512: f4be290759f63fdc920d5c02bd0d09acc4b06a5f053787d4afcd3c921b2e35d2bd97617fadae015da853dc189f559fb8d2c6e58d53e4cabfac9af151cd97ad19
2019-12-06 13:37:30 -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 Merge #15931: Remove GetDepthInMainChain dependency on locked chain interface 2019-11-08 23:23:14 +13:00
rpcwallet.cpp Merge #17283: rpc: improve getaddressinfo test coverage, help, code docs 2019-11-26 17:11:16 +01:00
rpcwallet.h Add EnsureLegacyScriptPubKeyMan and use in rpcwallet.cpp 2019-11-05 10:13:43 -05:00
scriptpubkeyman.cpp Key pool: Fix omitted pre-split count in GetKeyPoolSize 2019-12-02 11:57:46 -05:00
scriptpubkeyman.h Key pool: Change ReturnDestination interface to take address instead of key 2019-12-02 11:57:46 -05:00
wallet.cpp Merge #17373: wallet: Various fixes and cleanup to keypool handling in LegacyScriptPubKeyMan and CWallet 2019-12-06 13:37:30 -05:00
wallet.h Merge #17373: wallet: Various fixes and cleanup to keypool handling in LegacyScriptPubKeyMan and CWallet 2019-12-06 13:37:30 -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