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
  1. mcassano commented at 7:11 PM on December 6, 2012: contributor

    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.

  2. 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.

  3. Diapolo commented at 8:58 PM on December 6, 2012: none

    Now you just need to merge your 2 commits into one.

  4. 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).

  5. mcassano commented at 9:10 PM on December 6, 2012: contributor

    Thank you for the feedback, I just rebased so I think it's just one commit now with proper spacing.

  6. sipa commented at 11:10 PM on December 6, 2012: member

    Now fix the commit message, and you're golden. ACK on the code change.

  7. add rescan bool to importprivkey to control whether to do a rescan after import 44051af1a8
  8. BitcoinPullTester commented at 2:19 AM on December 7, 2012: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/331bc98a7fb0aa5bee965faa8cf1a58868d28558 for binaries and test log.

  9. mcassano commented at 2:19 AM on December 7, 2012: contributor

    I 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.

  10. BitcoinPullTester commented at 4:04 AM on December 7, 2012: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/44051af1a87a5fb8f4e88442c0eb64a1b4ecf2e6 for binaries and test log.

  11. gavinandresen referenced this in commit 51dc438942 on Dec 12, 2012
  12. gavinandresen merged this on Dec 12, 2012
  13. gavinandresen closed this on Dec 12, 2012

  14. mcassano deleted the branch on Feb 18, 2013
  15. laudney referenced this in commit 9d7326f2ea on Mar 19, 2014
  16. HashUnlimited referenced this in commit 243cd17ebb on Jun 4, 2018
  17. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

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

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me