CWallet::TopUpKeyPool() takes optional pool size argument

Also, GetKeyPoolSize() now returns an accurate type, unsigned int.
This commit is contained in:
Jeff Garzik
2013-06-25 16:07:29 -04:00
parent 481d899794
commit 13dd2d090e
3 changed files with 10 additions and 5 deletions

View File

@@ -1553,7 +1553,7 @@ bool CWallet::NewKeyPool()
return true;
}
bool CWallet::TopUpKeyPool()
bool CWallet::TopUpKeyPool(unsigned int kpSize)
{
{
LOCK(cs_wallet);
@@ -1564,7 +1564,12 @@ bool CWallet::TopUpKeyPool()
CWalletDB walletdb(strWalletFile);
// Top up key pool
unsigned int nTargetSize = max(GetArg("-keypool", 100), 0LL);
unsigned int nTargetSize;
if (kpSize > 0)
nTargetSize = kpSize;
else
nTargetSize = max(GetArg("-keypool", 100), 0LL);
while (setKeyPool.size() < (nTargetSize + 1))
{
int64 nEnd = 1;