I use a lot of vanity addresses and I don't need to rescan the chain when importing. I like the ability to optionally request not to do a rescan. Attached is a working example of this.
add rescan bool to importprivkey to control whether to do a rescan after import #2080
pull mcassano wants to merge 1 commits into bitcoin:master from mcassano:importprivkey_rescan_false changing 1 files +13 −5-
mcassano commented at 7:11 PM on December 6, 2012: contributor
-
in src/rpcdump.cpp:None in 9dd01e40fe outdated
66 | @@ -61,9 +67,11 @@ Value importprivkey(const Array& params, bool fHelp) 67 | 68 | if (!pwalletMain->AddKey(key)) 69 | throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); 70 | - 71 | - pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); 72 | - pwalletMain->ReacceptWalletTransactions(); 73 | + 74 | + if (fRescan) {
gavinandresen commented at 7:36 PM on December 6, 2012:Nit: our coding style is: 4 space indenting, no tabs
(see doc/coding.txt)
mcassano commented at 7:47 PM on December 6, 2012:My mistake, fixed now.
Diapolo commented at 8:58 PM on December 6, 2012: noneNow you just need to merge your 2 commits into one.
in src/rpcdump.cpp:None in 52a13bd716 outdated
66 | @@ -61,9 +67,11 @@ Value importprivkey(const Array& params, bool fHelp) 67 | 68 | if (!pwalletMain->AddKey(key)) 69 | throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); 70 | - 71 | - pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); 72 | - pwalletMain->ReacceptWalletTransactions(); 73 | + 74 | + if (fRescan) { 75 | + pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true);
Diapolo commented at 8:58 PM on December 6, 2012:And this are still only 2 spaces (same above and below).
mcassano commented at 9:10 PM on December 6, 2012: contributorThank you for the feedback, I just rebased so I think it's just one commit now with proper spacing.
sipa commented at 11:10 PM on December 6, 2012: memberNow fix the commit message, and you're golden. ACK on the code change.
add rescan bool to importprivkey to control whether to do a rescan after import 44051af1a8BitcoinPullTester commented at 2:19 AM on December 7, 2012: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/331bc98a7fb0aa5bee965faa8cf1a58868d28558 for binaries and test log.
mcassano commented at 2:19 AM on December 7, 2012: contributorI removed the mention of the tabs and spaces from the commit, I assume that is what was wrong with the message. Thanks for the ACK.
BitcoinPullTester commented at 4:04 AM on December 7, 2012: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/44051af1a87a5fb8f4e88442c0eb64a1b4ecf2e6 for binaries and test log.
gavinandresen referenced this in commit 51dc438942 on Dec 12, 2012gavinandresen merged this on Dec 12, 2012gavinandresen closed this on Dec 12, 2012mcassano deleted the branch on Feb 18, 2013laudney referenced this in commit 9d7326f2ea on Mar 19, 2014HashUnlimited referenced this in commit 243cd17ebb on Jun 4, 2018DrahtBot locked this on Sep 8, 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: 2026-04-21 21:16 UTC
More mirrored repositories can be found on mirror.b10c.me