Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: calkob on March 01, 2016, 12:55:44 AM



Title: Why does bitcoin take so long to import a privkey???
Post by: calkob on March 01, 2016, 12:55:44 AM
I am waiting about 30 mins for core to import a privkey, why is that ?


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: achow101 on March 01, 2016, 12:57:47 AM
I am waiting about 30 mins for core to import a privkey, why is that ?
Because it needs to rescan the entire blockchain to check for all of the transactions that involve the address associated with that private key. The blockchain is huge and this process takes a while.


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: Invulner on March 01, 2016, 12:57:58 AM
I am waiting about 30 mins for core to import a privkey, why is that ?

I use blockchain.info, and importing private keys are instant. Perhaps your wallet wasn't synced?


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: Goins on March 01, 2016, 01:06:23 AM
I am waiting about 30 mins for core to import a privkey, why is that ?

I use blockchain.info, and importing private keys are instant. Perhaps your wallet wasn't synced?
Blockchain.info is always up-to-date, that's why importing a key there happens within seconds. It shouldn't take too long when importing into Bitcoin Core either because it downloads the whole blockchain. If you import a key into a different client like MultiBit, then the client has to scan the blockchain for transactions associated to this key as knightdk already mentioned. Keep in mind, even though MultiBit doesn't need to download the whole Blockchain, it still needs to know about the transactions associated to your key.

What you can do is to import the key into the Blockchain.info web wallet and send all the funds to a new key. But then you will have to wait for the confirmations of course.


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: unholycactus on March 01, 2016, 02:50:34 AM
I am waiting about 30 mins for core to import a privkey, why is that ?

I use blockchain.info, and importing private keys are instant. Perhaps your wallet wasn't synced?

The wallet can be up to date and synced.
Like knightdk said, if you add an address that wasn't in the first place, the wallet has to check through the whole already downloaded blockchain to see if the address was used in any transactions.


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: calkob on March 01, 2016, 08:23:12 AM
Fair enough,  ;) thanks for the replies.  It was a newly generated address also.


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: CIYAM on March 01, 2016, 08:34:02 AM
There is an option to stop it from doing a re-scan (after the private key and label) so for newly created addresses you should use that.

Code:
importaddress "address" ( "label" rescan )
importprivkey "bitcoinprivkey" ( "label" rescan )


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: torrentheaven on March 01, 2016, 09:57:06 AM
Because when you import a privatekey to bitcoin core wallet it rescan , if you want to stop rescan you can use below format, it will rescan wallet later next time you open it


Code:
importprivkey "bitcoinprivkey" "label" false

replace bitcoinprivkey with your private key
and label with label that you want to add for imported address


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: calkob on March 01, 2016, 10:09:18 AM
There is an option to stop it from doing a re-scan (after the private key and label) so for newly created addresses you should use that.

Code:
importaddress "address" ( "label" rescan )
importprivkey "bitcoinprivkey" ( "label" rescan )


Thanks for that, so i import address 1st and then importprivkey after, as above?


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: CIYAM on March 01, 2016, 10:15:17 AM
Thanks for that, so i import address 1st and then importprivkey after, as above?

No - the "importaddress" is for "watch only" addresses (but if you don't provide the rescan parameter to them they'll behave in the same manner so I thought it was relevant to list both of these commands for others that might be following this).

For a private key you just use the "importprivkey" command (adding false after the label).


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: calkob on March 01, 2016, 10:31:23 AM
Because when you import a privatekey to bitcoin core wallet it rescan , if you want to stop rescan you can use below format, it will rescan wallet later next time you open it


Code:
importprivkey "bitcoinprivkey" "label" false

replace bitcoinprivkey with your private key
and label with label that you want to add for imported address

So as above, Again Many Thanks


Title: Re: Why does bitcoin take so long to import a privkey???
Post by: 7788bitcoin on March 01, 2016, 03:40:58 PM
Thanks for that, so i import address 1st and then importprivkey after, as above?

No - the "importaddress" is for "watch only" addresses (but if you don't provide the rescan parameter to them they'll behave in the same manner so I thought it was relevant to list both of these commands for others that might be following this).

For a private key you just use the "importprivkey" command (adding false after the label).


Will the core rescan automatically after you shutdown and then restart your software?