diff options
| author | Gavin Andresen <[email protected]> | 2013-08-14 22:01:22 -0700 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-08-14 22:01:22 -0700 |
| commit | 4323bfeafda4a5e0101710d94b518d41819a2325 (patch) | |
| tree | 6ddfef232d5928bda0e566f55a405a0b8040bf6c /src/wallet.cpp | |
| parent | Merge pull request #2877 from gavinandresen/qt_unittest_makefile (diff) | |
| parent | RPC: keypoolrefill gains optional size parameter (diff) | |
| download | discoin-4323bfeafda4a5e0101710d94b518d41819a2325.tar.xz discoin-4323bfeafda4a5e0101710d94b518d41819a2325.zip | |
Merge pull request #2776 from jgarzik/keypoolsize
RPC: keypoolrefill now permits optional size parameter, to bump keypool
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 88b07c9d7..8b9f3d34e 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1551,7 +1551,7 @@ bool CWallet::NewKeyPool() return true; } -bool CWallet::TopUpKeyPool() +bool CWallet::TopUpKeyPool(unsigned int kpSize) { { LOCK(cs_wallet); @@ -1562,7 +1562,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; |