Bitcoin Forum
June 07, 2024, 07:31:07 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Import many private keys  (Read 725 times)
andy-junior (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 15, 2014, 10:54:33 PM
 #1

I have to add 100 or more generated pairs :(private key, address),  one command "bitcoind importprivkey privkey address" executes about 25mins,  Is there in bitcoind a way to import many private keys at one time.
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
March 15, 2014, 11:13:37 PM
 #2

Run it like this:
importprivkey <key> "" false

That will import without rescanning. You'll probably have to restart with -reindex afterwards, so it finds the relevant transactions, but at least it'll only do it once.

Bitwasp Developer.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3416
Merit: 4658



View Profile
March 16, 2014, 12:55:12 PM
 #3

Run it like this:
importprivkey <key> "" false

That will import without rescanning. You'll probably have to restart with -reindex afterwards, so it finds the relevant transactions, but at least it'll only do it once.

If you run the first 99 imports with the "false" flag, then those 9 keys will import without scanning the blockchain for transactions.  The balance won't update to reflect any bitcoins that are accessible with those 99 keys, but the import will complete very quickly.

Then when you import the 100th key, leave the "false" flag off the import command.  After importing the key, the wallet should scan the entire blockchain just once and find all the transactions associated with all 100 imported keys. The balance will reflect all bitcoins from all imported keys.

If you find that the balance isn't correct after the imports, you can force the wallet to scan the blockchain with a -rescan command line option.
andy-junior (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 16, 2014, 09:34:33 PM
 #4

Thank you both, that helped
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!