I am doing some test, and am getting weird behavior with keypool.
In the 0.4.0rc1 bitcoin client:
If I set keypool=1, how many times should I be able to do getnewaddress?
Are there any resources where I can read about keypool, and how it works?
I am doing some test, and am getting weird behavior with keypool.
In the 0.4.0rc1 bitcoin client:
If I set keypool=1, how many times should I be able to do getnewaddress?
Are there any resources where I can read about keypool, and how it works?
You can do getnewaddress as many times as you want. The keypool parameter just sets how many extra keys the client creates when it needs to create keys. With keypool set to 1, the client will create one extra key every time it needs to create a key.
Setting keypool low will keep your wallet smaller. But it will mean you have to backup your wallet more often to avoid losing the keys to newly-created addresses.
The keypool is a collection of unused addresses in your wallet. The keypool parameter tells the client how many unused addresses to keep in its pool.
Almost every time you send a Bitcoin payment, some change is generated and sent to a previously unused address. If you have a keypool, then each time a new address is needed one of the keypool addresses is used, and a new address is created and placed in the keypool to replace the one that was just used.
The purpose of the keypool is to allow you to backup your wallet file less frequently and still have access to all your funds in the event of a hard drive failure. If you didn't have a keypool, and made a backup of your wallet, then made a payment, and then suffered a disk crash, you would lose the change which came from that payment because it would have been sent to a new address that wasn't in the backup.
With a keypool of 100 addresses, you can make up to 100 payments between backups and still be able to access all your funds.