Skip to content

Commit

Permalink
Merge bitcoin#23341: RPC: Better safety with newkeypool command and w…
Browse files Browse the repository at this point in the history
…allet backups

a2a9231 rpc: Add warning to user about newkeypool command (Samuel Dobson)

Pull request description:

  This PR prevents `newkeypool` from being run on non-HD wallets, because this would require a new backup every time, so it isn't very safe.

  David Harding also suggested [here](bitcoin#23093 (comment)) that the RPC help text should include a warning to the users about the interaction between newkeypool.

ACKs for top commit:
  achow101:
    ACK a2a9231

Tree-SHA512: 0aa497900f1d179764bce13ffce0bb081ba2ca354492bf2e04b21d0212e960b3ed13a386fbf65602b6b50461f4056a0285752ef707d312da28e82449cd8ea048
  • Loading branch information
achow101 authored and knst committed Feb 14, 2025
1 parent 4b326ad commit 0c6d31f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,12 @@ static RPCHelpMan keypoolrefill()
static RPCHelpMan newkeypool()
{
return RPCHelpMan{"newkeypool",
"\nEntirely clears and refills the keypool."+
"\nEntirely clears and refills the keypool.\n"
"WARNING: On non-HD wallets, this will require a new backup immediately, to include the new keys.\n"
"When restoring a backup of an HD wallet created before the newkeypool command is run, funds received to\n"
"new addresses may not appear automatically. They have not been lost, but the wallet may not find them.\n"
"This can be fixed by running the newkeypool command on the backup and then rescanning, so the wallet\n"
"re-generates the required keys." +
HELP_REQUIRING_PASSPHRASE,
{},
RPCResult{RPCResult::Type::NONE, "", ""},
Expand Down

0 comments on commit 0c6d31f

Please sign in to comment.