@@ -1892,6 +1892,33 @@ static RPCHelpMan keypoolrefill()
1892
1892
}
1893
1893
1894
1894
1895
+ static RPCHelpMan newkeypool ()
1896
+ {
1897
+ return RPCHelpMan{" newkeypool" ,
1898
+ " \n Entirely clears and refills the keypool." +
1899
+ HELP_REQUIRING_PASSPHRASE,
1900
+ {},
1901
+ RPCResult{RPCResult::Type::NONE, " " , " " },
1902
+ RPCExamples{
1903
+ HelpExampleCli (" newkeypool" , " " )
1904
+ + HelpExampleRpc (" newkeypool" , " " )
1905
+ },
1906
+ [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
1907
+ {
1908
+ std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest (request);
1909
+ if (!pwallet) return NullUniValue;
1910
+
1911
+ LOCK (pwallet->cs_wallet );
1912
+
1913
+ LegacyScriptPubKeyMan& spk_man = EnsureLegacyScriptPubKeyMan (*pwallet, true );
1914
+ spk_man.NewKeyPool ();
1915
+
1916
+ return NullUniValue;
1917
+ },
1918
+ };
1919
+ }
1920
+
1921
+
1895
1922
static RPCHelpMan walletpassphrase ()
1896
1923
{
1897
1924
return RPCHelpMan{" walletpassphrase" ,
@@ -4773,6 +4800,7 @@ static const CRPCCommand commands[] =
4773
4800
{ " wallet" , &listwallets, },
4774
4801
{ " wallet" , &loadwallet, },
4775
4802
{ " wallet" , &lockunspent, },
4803
+ { " wallet" , &newkeypool, },
4776
4804
{ " wallet" , &removeprunedfunds, },
4777
4805
{ " wallet" , &rescanblockchain, },
4778
4806
{ " wallet" , &send, },
0 commit comments