Russell Yanofsky
491a599b37
Get rid of confusing LegacyScriptPubKeyMan::TopUpKeyPool method
...
Previous discussion https://github.com/bitcoin/bitcoin/pull/17304#discussion_r340307903
2019-11-05 10:43:36 -05:00
Russell Yanofsky
4a0abf694e
Pass CTxDestination to ScriptPubKeyMan::GetMetadata
...
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
a18edd7b38
from
https://github.com/bitcoin/bitcoin/pull/17304
Change suggested by Andrew Chow <achow101-github@achow101.com> in
https://github.com/bitcoin/bitcoin/pull/17304#discussion_r340345745 and
https://github.com/bitcoin/bitcoin/pull/17381#issuecomment-549994944
2019-11-05 10:36:55 -05:00
Andrew Chow
152b0a00d8
Refactor: Move nTimeFirstKey accesses out of CWallet
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
7ef47b88e6
Refactor: Move GetKeypoolSize code out of CWallet
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
089e17d45c
Refactor: Move RewriteDB code out of CWallet
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
0eac7088ab
Refactor: Move SetupGeneration code out of CWallet
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
f45d12b36c
Refactor: Move HavePrivateKeys code out of CWallet::CreateWalletFromFile
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
8b0d82bb42
Refactor: Move Upgrade code out of CWallet::CreateWalletFromFile
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
46865ec958
Refactor: Move MarkUnusedAddresses code out of CWallet::AddToWalletIfInvolvingMe
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
a18edd7b38
Refactor: Move GetMetadata code out of getaddressinfo
...
Easier to review ignoring whitespace:
git log -p -n1 -w
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
9716bbe0f8
Refactor: Move LoadKey LegacyScriptPubKeyMan method definition
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
67be6b9e21
Refactor: Move SetAddressBookWithDB call out of LegacyScriptPubKeyMan::ImportScriptPubKeys
...
This commit does not change behavior.
2019-11-01 22:58:05 -04:00
Andrew Chow
fc2867fdf5
refactor: Replace UnsetWalletFlagWithDB with UnsetBlankWalletFlag in 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.
2019-11-01 22:58:05 -04:00
Andrew Chow
0391aba52d
Remove SetWalletFlag from WalletStorage
...
SetWalletFlag is unused.
Does not change any behavior
2019-11-01 22:58:05 -04:00
Andrew Chow
769acef857
Refactor: Move SetAddressBook call out of LegacyScriptPubKeyMan::GetNewDestination
...
This commit does not change behavior.
2019-11-01 22:56:37 -04:00
Andrew Chow
acedc5b823
Refactor: Add new ScriptPubKeyMan virtual methods
...
This commit does not change behavior.
2019-11-01 22:56:37 -04:00
Andrew Chow
533d8b364f
Refactor: Declare LegacyScriptPubKeyMan methods as virtual
...
This commit does not change behavior.
2019-11-01 22:56:37 -04:00
Andrew Chow
b4cb18bce3
MOVEONLY: Reorder LegacyScriptPubKeyMan methods
...
Can verify move-only with:
git log -p -n1 --color-moved
This commit is move-only and doesn't change code or affect behavior.
2019-11-01 22:56:37 -04:00
Russell Yanofsky
2632b1f124
doc: Clarify WalletStorage / Wallet relation
...
Suggested by MarcoFalke <falke.marco@gmail.com>
https://github.com/bitcoin/bitcoin/pull/17260#discussion_r340031507
2019-10-29 12:23:47 -04:00
Andrew Chow
f201ba59ff
Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes
...
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.
2019-10-25 19:20:24 -04:00
Andrew Chow
6702048f91
MOVEONLY: Move key handling code out of wallet to keyman file
...
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.
2019-10-25 19:20:24 -04:00