Author

Topic: Why does bitcoin take so long to import a privkey??? (Read 1388 times)

newbie
Activity: 20
Merit: 0
I had this happen today.  Tried to import an old private key and it's taking forever, several hours.  If you do this in bitcoincore maybe do it before going to bed.
legendary
Activity: 2282
Merit: 1023
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?
hero member
Activity: 1106
Merit: 521
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
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
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).
hero member
Activity: 1106
Merit: 521
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?
hero member
Activity: 952
Merit: 1000
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
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
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 )
hero member
Activity: 1106
Merit: 521
Fair enough,  Wink thanks for the replies.  It was a newly generated address also.
legendary
Activity: 1078
Merit: 1024
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.
newbie
Activity: 42
Merit: 0
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.
sr. member
Activity: 266
Merit: 250
Invulner
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?
staff
Activity: 3458
Merit: 6793
Just writing some code
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.
hero member
Activity: 1106
Merit: 521
I am waiting about 30 mins for core to import a privkey, why is that ?
Jump to: