|
|
@ -81,7 +81,7 @@ Value getinfo(const Array& params, bool fHelp) |
|
|
|
obj.push_back(Pair("difficulty", (double)GetDifficulty())); |
|
|
|
obj.push_back(Pair("difficulty", (double)GetDifficulty())); |
|
|
|
obj.push_back(Pair("testnet", TestNet())); |
|
|
|
obj.push_back(Pair("testnet", TestNet())); |
|
|
|
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime())); |
|
|
|
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime())); |
|
|
|
obj.push_back(Pair("keypoolsize", pwalletMain->GetKeyPoolSize())); |
|
|
|
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); |
|
|
|
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); |
|
|
|
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); |
|
|
|
if (pwalletMain->IsCrypted()) |
|
|
|
if (pwalletMain->IsCrypted()) |
|
|
|
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime)); |
|
|
|
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime)); |
|
|
@ -1253,17 +1253,24 @@ Value backupwallet(const Array& params, bool fHelp) |
|
|
|
|
|
|
|
|
|
|
|
Value keypoolrefill(const Array& params, bool fHelp) |
|
|
|
Value keypoolrefill(const Array& params, bool fHelp) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fHelp || params.size() > 0) |
|
|
|
if (fHelp || params.size() > 1) |
|
|
|
throw runtime_error( |
|
|
|
throw runtime_error( |
|
|
|
"keypoolrefill\n" |
|
|
|
"keypoolrefill [new-size]\n" |
|
|
|
"Fills the keypool." |
|
|
|
"Fills the keypool." |
|
|
|
+ HelpRequiringPassphrase()); |
|
|
|
+ HelpRequiringPassphrase()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int kpSize = max(GetArg("-keypool", 100), 0LL); |
|
|
|
|
|
|
|
if (params.size() > 0) { |
|
|
|
|
|
|
|
if (params[0].get_int() < 0) |
|
|
|
|
|
|
|
throw JSONRPCError(-8, "Invalid parameter, expected valid size"); |
|
|
|
|
|
|
|
kpSize = (unsigned int) params[0].get_int(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
EnsureWalletIsUnlocked(); |
|
|
|
EnsureWalletIsUnlocked(); |
|
|
|
|
|
|
|
|
|
|
|
pwalletMain->TopUpKeyPool(); |
|
|
|
pwalletMain->TopUpKeyPool(kpSize); |
|
|
|
|
|
|
|
|
|
|
|
if (pwalletMain->GetKeyPoolSize() < GetArg("-keypool", 100)) |
|
|
|
if (pwalletMain->GetKeyPoolSize() < kpSize) |
|
|
|
throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool."); |
|
|
|
throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool."); |
|
|
|
|
|
|
|
|
|
|
|
return Value::null; |
|
|
|
return Value::null; |
|
|
|