aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.h
Commit message (Collapse)AuthorAgeFilesLines
...
* | scripted-diff: Bump copyright of files changed in 2020MarcoFalke2020-01-151-1/+1
| | | | | | | | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* | scripted-diff: Replace CCriticalSection with RecursiveMutexMarcoFalke2020-01-151-1/+1
| | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- # Delete outdated alias for RecursiveMutex sed -i -e '/CCriticalSection/d' ./src/sync.h # Replace use of outdated alias with RecursiveMutex sed -i -e 's/CCriticalSection/RecursiveMutex/g' $(git grep -l CCriticalSection) -END VERIFY SCRIPT-
* | Merge #17537: wallet: Cleanup and move opportunistic and superfluous TopUp()sfanquake2019-12-171-0/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 https://github.com/bitcoin/bitcoin/pull/17537/commits/6e77a7b65cda1b46ce42f0c99ca91562255aeb28 only change is slight elaboration on comment ryanofsky: Code review ACK 6e77a7b65cda1b46ce42f0c99ca91562255aeb28. Only the comment changed since my previous review. Tree-SHA512: bdfc8d303842c3fb7c3d40af7abfa6d9dac4ef71a24922bb92229674ee89bfe3113ebb46d3903ac48ef99f0a7d6eaac33282495844f2b31f91b8df55084c421f
| * | keypool: Add comment about TopUp and when to use itAndrew Chow2019-12-051-0/+4
| | |
* | | Replace LegacyScriptPubKeyMan::IsCrypted with ↵Andrew Chow2019-12-061-1/+0
| | | | | | | | | | | | LegacyScriptPubKeyMan::HasEncryptionKeys
* | | Remove SetCrypted() and fUseCrypto; Change IsCrypted()'s implementationAndrew Chow2019-12-061-2/+0
| | | | | | | | | | | | | | | | | | | | | Removes SetCrypted() and fUseCrypto as we don't need them anymore. SetCrypted calls in LegacyScriptPubKeyMan are replaced with mapKeys.empty() IsCrypted() is changed to just call HasEncryptionKeys()
* | | Rename EncryptKeys to Encrypt and pass in the encrypted batch to useAndrew Chow2019-12-061-2/+2
| | |
* | | Move fDecryptionThoroughlyChecked from CWallet to LegacyScriptPubKeyManAndrew Chow2019-12-061-1/+3
| | |
* | | Move Unlock implementation to LegacyScriptPubKeyManAndrew Chow2019-12-061-0/+4
| | | | | | | | | | | | | | | CWallet::Unlock is changed to call ScriptPubKeyMan::CheckDecryptionKey and the original implementation of Unlock is renamed to CheckDecryptionKey.
* | | Replace LegacyScriptPubKeyMan::vMasterKey with GetDecryptionKey()Andrew Chow2019-12-061-1/+0
| | |
* | | Add GetEncryptionKey() and HasEncryptionKeys() to WalletStorageAndrew Chow2019-12-061-0/+2
| |/ |/| | | | | | | Adds functions in WalletStorage that allow ScriptPubKeyMans to check and get encryption keys from the wallet.
* | Key pool: Change ReturnDestination interface to take address instead of keyAndrew Chow2019-12-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | In order for ScriptPubKeyMan to be generic and work with future ScriptPubKeyMans, 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. The CPubKey argument of KeepDestination is also removed so that it is more generic. Instead of taking a CPubKey or a CTxDestination, we just use the nIndex given to find the pubkey.
* | Key pool: Move LearnRelated and GetDestination callsAndrew Chow2019-12-021-2/+2
| | | | | | | | | | | | | | | | Addresses are determined by LegacyScriptPubKeyMan::GetReservedDestination instead of ReserveDestination::GetReservedDestination as other ScriptPubKeyMan implementations may construct addresses differently This does not change behavior.
* | Add OutputType and CPubKey parameters to KeepDestinationAndrew Chow2019-11-261-3/+3
| | | | | | | | | | These need to be added so that LearnRelatedScripts can be called from within KeepDestination later.
* | Rename Keep/ReturnKey to Keep/ReturnDestination and remove the wrapperAndrew Chow2019-11-261-3/+0
|/ | | | | There is no reason to have Keep/ReturnDestination to be a wrapper for Keep/ReturnKey. Instead just make them the same function.
* Get rid of confusing LegacyScriptPubKeyMan::TopUpKeyPool methodRussell Yanofsky2019-11-051-1/+0
| | | | Previous discussion https://github.com/bitcoin/bitcoin/pull/17304#discussion_r340307903
* Pass CTxDestination to ScriptPubKeyMan::GetMetadataRussell Yanofsky2019-11-051-2/+3
| | | | | | | | | | | | Pass CTxDestination instead of more ambiguous uint160 hash value. This is more type safe and more efficient since it avoids doing map lookups that will always fail and were not done previously before a18edd7b383d667b15b6d4b87aa3a055a9fa5051 from https://github.com/bitcoin/bitcoin/pull/17304 Change suggested by Andrew Chow <[email protected]> in https://github.com/bitcoin/bitcoin/pull/17304#discussion_r340345745 and https://github.com/bitcoin/bitcoin/pull/17381#issuecomment-549994944
* Refactor: Move nTimeFirstKey accesses out of CWalletAndrew Chow2019-11-011-0/+4
| | | | This commit does not change behavior.
* Refactor: Move GetKeypoolSize code out of CWalletAndrew Chow2019-11-011-0/+2
| | | | This commit does not change behavior.
* Refactor: Move RewriteDB code out of CWalletAndrew Chow2019-11-011-0/+5
| | | | This commit does not change behavior.
* Refactor: Move SetupGeneration code out of CWalletAndrew Chow2019-11-011-0/+8
| | | | This commit does not change behavior.
* Refactor: Move HavePrivateKeys code out of CWallet::CreateWalletFromFileAndrew Chow2019-11-011-0/+4
| | | | This commit does not change behavior.
* Refactor: Move Upgrade code out of CWallet::CreateWalletFromFileAndrew Chow2019-11-011-0/+5
| | | | This commit does not change behavior.
* Refactor: Move MarkUnusedAddresses code out of CWallet::AddToWalletIfInvolvingMeAndrew Chow2019-11-011-0/+7
| | | | This commit does not change behavior.
* Refactor: Move GetMetadata code out of getaddressinfoAndrew Chow2019-11-011-0/+4
| | | | | | | | Easier to review ignoring whitespace: git log -p -n1 -w This commit does not change behavior.
* Refactor: Move LoadKey LegacyScriptPubKeyMan method definitionAndrew Chow2019-11-011-1/+1
| | | | This commit does not change behavior.
* Refactor: Move SetAddressBookWithDB call out of ↵Andrew Chow2019-11-011-1/+1
| | | | | | LegacyScriptPubKeyMan::ImportScriptPubKeys This commit does not change behavior.
* refactor: Replace UnsetWalletFlagWithDB with UnsetBlankWalletFlag in ↵Andrew Chow2019-11-011-1/+1
| | | | | | | | | | ScriptPubKeyMan ScriptPubKeyMan is only using UnsetWalletFlagWithDB to unset the blank wallet flag. Just make that it's own function and not expose the flag writing directly. This does not change behavior.
* Remove SetWalletFlag from WalletStorageAndrew Chow2019-11-011-1/+0
| | | | | | SetWalletFlag is unused. Does not change any behavior
* Refactor: Move SetAddressBook call out of ↵Andrew Chow2019-11-011-1/+2
| | | | | | LegacyScriptPubKeyMan::GetNewDestination This commit does not change behavior.
* Refactor: Add new ScriptPubKeyMan virtual methodsAndrew Chow2019-11-011-3/+14
| | | | This commit does not change behavior.
* Refactor: Declare LegacyScriptPubKeyMan methods as virtualAndrew Chow2019-11-011-7/+22
| | | | This commit does not change behavior.
* MOVEONLY: Reorder LegacyScriptPubKeyMan methodsAndrew Chow2019-11-011-92/+91
| | | | | | | | Can verify move-only with: git log -p -n1 --color-moved This commit is move-only and doesn't change code or affect behavior.
* doc: Clarify WalletStorage / Wallet relationRussell Yanofsky2019-10-291-1/+1
| | | | | Suggested by MarcoFalke <[email protected]> https://github.com/bitcoin/bitcoin/pull/17260#discussion_r340031507
* Refactor: Split up CWallet and LegacyScriptPubKeyMan and classesAndrew Chow2019-10-251-0/+240
| | | | | | | | | | | | | | | | | | | | | | | This moves CWallet members and methods dealing with keys to a new LegacyScriptPubKeyMan class, and updates calling code to reference the new class instead of CWallet. Most of the changes are simple text replacements and variable substitutions easily verified with: git log -p -n1 -U0 --word-diff-regex=. The only nontrivial chunk of code added is the new LegacyScriptPubKeyMan class declaration, but this code isn't new and is just selectively copied and moved from the previous CWallet class declaration. This can be verified with: git log -p -n1 --color-moved=dimmed_zebra src/wallet/scriptpubkeyman.h src/wallet/wallet.h or git diff HEAD~1:src/wallet/wallet.h HEAD:src/wallet/scriptpubkeyman.h This commit does not change behavior.
* MOVEONLY: Move key handling code out of wallet to keyman fileAndrew Chow2019-10-251-0/+115
Start moving wallet and ismine code to scriptpubkeyman.h, scriptpubkeyman.cpp The easiest way to review this commit is to run: git log -p -n1 --color-moved=dimmed_zebra And check that everything is a move (other than includes and copyrights comments). This commit is move-only and doesn't change code or affect behavior.