You can clone with
HTTPS or Subversion.
I recently needed to import some private keys into my wallet.
I knew the addresses had never been used, and so didn't need to rescan the blockchain, but there's no way to import a private key without the client automatically rescanning the whole blockchain.
There's also no way to import multiple private keys at once, so to import 5 private keys I had to wait while the client scanned the whole blockchain 5 times over for transactions I knew it wouldn't find anyway.
I'd like to be able to either:
I ended up commenting these two lines in rpcdump.cpp to get the job done:
// pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true);
but would prefer a better solution.
Both sound good with me, as they can be useful in different scenarios.
I think it had also been mentioned that it might be useful to be able to specify how far back to rescan (either from a block or a date I guess).
The second part seems to have been fixed by 44051af.
Why not simply remove the automatic rescan since a manual rescan can be performed any time someone wishes to run one?
@rebroad because that would leave the wallet in an undertested 'inconsistent' state. (e.g. you may find out transactions from the network spending prior transactions of yours which you don't know about)
this is an issue, would love to see the suggested features
import multiple keys with a single importprivkey RPC call, or
optionally suppress the blockchain rescan
This was fixed by 44051af which allows you to suppress the rescan.
I think this is fixed, closing.
it's really not clear from the current help output how to suppress the rescan...
Yes, this should be clarified. Moreover, there's no way to stop the rescan once it has started. You can't even close bitcoin (AFAIK), only kill it with -9. Actually, the format for the command is importprivkey 5HzBeH... "account name" false if you don't want to rescan. And the default is true which is confusing — the help line looks like importprivkey "bitcoinprivkey" ( "label" rescan ) so it makes me think that if I don't add rescan it won't be rescanned.
importprivkey 5HzBeH... "account name" false
importprivkey "bitcoinprivkey" ( "label" rescan )
#4922 raised to address this, @rkfg