Skip to content

Commit aef06a2

Browse files
achow101knst
authored andcommitted
Merge bitcoin#23341: RPC: Better safety with newkeypool command and wallet 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
1 parent 75e77e0 commit aef06a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,12 @@ static RPCHelpMan keypoolrefill()
17891789
static RPCHelpMan newkeypool()
17901790
{
17911791
return RPCHelpMan{"newkeypool",
1792-
"\nEntirely clears and refills the keypool."+
1792+
"\nEntirely clears and refills the keypool.\n"
1793+
"WARNING: On non-HD wallets, this will require a new backup immediately, to include the new keys.\n"
1794+
"When restoring a backup of an HD wallet created before the newkeypool command is run, funds received to\n"
1795+
"new addresses may not appear automatically. They have not been lost, but the wallet may not find them.\n"
1796+
"This can be fixed by running the newkeypool command on the backup and then rescanning, so the wallet\n"
1797+
"re-generates the required keys." +
17931798
HELP_REQUIRING_PASSPHRASE,
17941799
{},
17951800
RPCResult{RPCResult::Type::NONE, "", ""},

0 commit comments

Comments
 (0)