diff options
author | Jeff Garzik <jgarzik@bitpay.com> | 2013-06-25 16:07:29 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@bitpay.com> | 2013-06-25 16:07:29 -0400 |
commit | 13dd2d090e1acf8895854cedea18e38a6278c7ea (patch) | |
tree | 6aab366e467151d693ea9d1a90110c86e5f08058 /src/wallet.cpp | |
parent | 481d89979457d69da07edd99fba451fd42a47f5c (diff) |
CWallet::TopUpKeyPool() takes optional pool size argument
Also, GetKeyPoolSize() now returns an accurate type, unsigned int.
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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; |