From 13dd2d090e1acf8895854cedea18e38a6278c7ea Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 25 Jun 2013 16:07:29 -0400 Subject: CWallet::TopUpKeyPool() takes optional pool size argument Also, GetKeyPoolSize() now returns an accurate type, unsigned int. --- src/wallet.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/wallet.cpp') diff --git a/src/wallet.cpp b/src/wallet.cpp index 488787f967..e64d3150a3 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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; -- cgit v1.2.3