aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-08-14 22:01:22 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-08-14 22:01:22 -0700
commit4323bfeafda4a5e0101710d94b518d41819a2325 (patch)
tree6ddfef232d5928bda0e566f55a405a0b8040bf6c /src/wallet.cpp
parent5c28d820b613d01c0ebd8cb3ca7196c35b3e9d98 (diff)
parent36bd46f1c4330fa57a3730bd80706eca11510b55 (diff)
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.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 88b07c9d76..8b9f3d34e1 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;