LegacyScriptPubKeyMan code cleanups #17381
pull ryanofsky wants to merge 5 commits into bitcoin:master from ryanofsky:pr/keyman-cleanup2 changing 6 files +56 −67-
ryanofsky commented at 4:04 pm on November 5, 2019: member
-
Add EnsureLegacyScriptPubKeyMan and use in rpcwallet.cpp
This also fixes unused variable warnings in rpcdump.cpp
-
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 a18edd7b383d667b15b6d4b87aa3a055a9fa5051 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
-
Get rid of confusing LegacyScriptPubKeyMan::TopUpKeyPool method
Previous discussion https://github.com/bitcoin/bitcoin/pull/17304#discussion_r340307903
-
Clean up nested scope in GetReservedDestination
Suggested https://github.com/bitcoin/bitcoin/pull/17304#discussion_r341194391 by Gregory Sanders <gsanders87@gmail.com> Reason for keeping the `return true` `return false` verbosity is that more code will be added after the ReserveKeyFromKeyPool() call before returning.
-
Add missing SetupGeneration error handling in EncryptWallet
Suggested https://github.com/bitcoin/bitcoin/pull/17304#discussion_r341286026 by me
-
ryanofsky added this to the "PRs" column in a project
-
ryanofsky force-pushed on Nov 5, 2019
-
fanquake added the label Wallet on Nov 5, 2019
-
in src/wallet/rpcwallet.cpp:3769 in 1c93192ae6 outdated
3765@@ -3766,14 +3766,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request) 3766 ScriptPubKeyMan* spk_man = pwallet->GetScriptPubKeyMan(); 3767 if (spk_man) { 3768 CKeyID key_id = GetKeyForDestination(*provider, dest);
Sjors commented at 5:34 pm on November 5, 2019:Maybe add a comment or assertion that only LegacyScriptPubKeyMan should usekey_id
.Sjors approvedSjors commented at 5:42 pm on November 5, 2019: memberCode review ACK ~5ed6daf4b703b6811d7b9f366edba35042de31f7~ 5b3a0b4ryanofsky force-pushed on Nov 5, 2019ryanofsky commented at 6:32 pm on November 5, 2019: memberUpdated 5ed6daf4b703b6811d7b9f366edba35042de31f7 -> 5b3a0b4fbebcb84c6ab83df40c00be075d5ef28b (pr/keyman-cleanup2.2
->pr/keyman-cleanup2.3
, compare) with requested code commentachow101 commented at 8:01 pm on November 5, 2019: memberI’m not sure that the
GetMetadata
change is really the right direction. What I was thinking was more of passing in the scriptPubKey directly (or maybe a CTxDestination?) and pulling from it the key id or script id via the Solver.Everything else looks good.
DrahtBot commented at 8:21 pm on November 5, 2019: memberThe following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #17373 (wallet: Various fixes and cleanup to keypool handling in LegacyScriptPubKeyMan and CWallet by achow101)
- #17283 (rpc: improve getaddressinfo test coverage, help, code docs by jonatack)
- #17261 (Make ScriptPubKeyMan an actual interface and the wallet to have multiple by achow101)
- #16528 ([WIP] Native Descriptor Wallets (take 2) by achow101)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
ryanofsky force-pushed on Nov 5, 2019ryanofsky referenced this in commit e7c2161f90 on Nov 5, 2019ryanofsky force-pushed on Nov 5, 2019ryanofsky commented at 9:15 pm on November 5, 2019: memberUpdated 5b3a0b4fbebcb84c6ab83df40c00be075d5ef28b -> 1f54dd2184cd41268c5c6739befaec4cd60219ae (pr/keyman-cleanup2.3
->pr/keyman-cleanup2.4
, compare) replacingGetMetadata
CScript
argument withCTxDestination
achow101 commented at 10:45 pm on November 5, 2019: memberCode review ACK 1f54dd2184cd41268c5c6739befaec4cd60219aeSjors commented at 7:44 am on November 6, 2019: memberAppVeyor failure (could be random, I restarted it):
0 C:\projects\bitcoin\build_msvc\x64\Release\libleveldb\libleveldb.lib 12433 libzmq-mt-s-4_3_3.lib(zmq.cpp.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance 22434 14>bech32_tests.obj : error LNK2001: unresolved external symbol "bool __cdecl CaseInsensitiveEqual(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?CaseInsensitiveEqual@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj] 32435 14>C:\projects\bitcoin\build_msvc\x64\Release\test_bitcoin.exe : fatal error LNK1120: 1 unresolved externals [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj] 42436 14>Done Building Project "C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj" (default targets) -- FAILED. 52437 1>Done Building Project "C:\projects\bitcoin\build_msvc\bitcoin.sln" (default targets) -- FAILED. 62438 72439Build FAILED. 82440 92441 "C:\projects\bitcoin\build_msvc\bitcoin.sln" (default target) (1) -> 102442 "C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj" (default target) (14) -> 112443 (Link target) -> 122444 bech32_tests.obj : error LNK2001: unresolved external symbol "bool __cdecl CaseInsensitiveEqual(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?CaseInsensitiveEqual@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj] 132445 C:\projects\bitcoin\build_msvc\x64\Release\test_bitcoin.exe : fatal error LNK1120: 1 unresolved externals [C:\projects\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj] 142446 152447 0 Warning(s) 162448 2 Error(s)
Sjors commented at 8:14 am on November 6, 2019: memberCode review ACK 1f54dd2ryanofsky commented at 1:40 pm on November 6, 2019: memberAppVeyor failure (could be random, I restarted it):
Appveyor error is apparently unrelated and fixed by #17384 (comment)
ryanofsky force-pushed on Nov 6, 2019ryanofsky commented at 2:11 pm on November 6, 2019: memberUpdated 1f54dd2184cd41268c5c6739befaec4cd60219ae -> 05b224a175065aee4d6d9c471722bc4503f01fdf (pr/keyman-cleanup2.4
->pr/keyman-cleanup2.5
, compare) just fixing now outdatedGetMetadata
commentSjors commented at 4:01 pm on November 6, 2019: memberre-ACK 05b224alaanwj commented at 4:23 pm on November 6, 2019: memberCode review ACK 05b224a175065aee4d6d9c471722bc4503f01fdflaanwj referenced this in commit 976cc766c4 on Nov 6, 2019laanwj merged this on Nov 6, 2019laanwj closed this on Nov 6, 2019
sidhujag referenced this in commit 19238f8e6c on Nov 7, 2019fanquake moved this from the "PRs" to the "Done" column in a project
HashUnlimited referenced this in commit 5a7db3b40f on Apr 17, 2020jasonbcox referenced this in commit 6c1781a66c on Sep 11, 2020jasonbcox referenced this in commit 0b5daf4ba8 on Sep 11, 2020jasonbcox referenced this in commit fa3481add5 on Sep 11, 2020jasonbcox referenced this in commit 709706b9d7 on Sep 11, 2020jasonbcox referenced this in commit 7e4e5d2a9f on Sep 11, 2020sidhujag referenced this in commit 682a4772a0 on Nov 10, 2020DrahtBot locked this on Dec 16, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 18:12 UTC
More mirrored repositories can be found on mirror.b10c.me