Skip to content

Commit f281f8f

Browse files
author
MarcoFalke
committed
Merge #13074: [trivial] Correct help text for importaddress RPC
2c71edc [wallet] [rpc] Fix importaddress help text (John Newbery) Pull request description: Help text for `importaddress` referred to the first parameter as `script`, when in fact it's `address`. Calling with a script argument fails: ``` → bcli -named importaddress script=2N3qhMpHK8WNo7wv87W9eHMgvGyJU1593Ei error code: -8 error message: Unknown named parameter script → bcli -named importaddress address=2N3qhMpHK8WNo7wv87W9eHMgvGyJU1593Ei # success! ``` Tree-SHA512: 24dcb2cbd0a43e25896b1c67fa0386df2453ec04d49a339e10992417b3921ce3df8a6aa5abba7d2237d6188b018948b2a21ea2f04d37120ad36c31c7b7fc9f1c
2 parents 8c36432 + 2c71edc commit f281f8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/wallet/rpcdump.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ UniValue importaddress(const JSONRPCRequest& request)
257257
if (request.fHelp || request.params.size() < 1 || request.params.size() > 4)
258258
throw std::runtime_error(
259259
"importaddress \"address\" ( \"label\" rescan p2sh )\n"
260-
"\nAdds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n"
260+
"\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n"
261261
"\nArguments:\n"
262-
"1. \"script\" (string, required) The hex-encoded script (or address)\n"
262+
"1. \"address\" (string, required) The Bitcoin address (or hex-encoded script)\n"
263263
"2. \"label\" (string, optional, default=\"\") An optional label\n"
264264
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
265265
"4. p2sh (boolean, optional, default=false) Add the P2SH version of the script as well\n"
@@ -269,12 +269,12 @@ UniValue importaddress(const JSONRPCRequest& request)
269269
"\nNote: If you import a non-standard raw script in hex form, outputs sending to it will be treated\n"
270270
"as change, and not show up in many RPCs.\n"
271271
"\nExamples:\n"
272-
"\nImport a script with rescan\n"
273-
+ HelpExampleCli("importaddress", "\"myscript\"") +
272+
"\nImport an address with rescan\n"
273+
+ HelpExampleCli("importaddress", "\"myaddress\"") +
274274
"\nImport using a label without rescan\n"
275-
+ HelpExampleCli("importaddress", "\"myscript\" \"testing\" false") +
275+
+ HelpExampleCli("importaddress", "\"myaddress\" \"testing\" false") +
276276
"\nAs a JSON-RPC call\n"
277-
+ HelpExampleRpc("importaddress", "\"myscript\", \"testing\", false")
277+
+ HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false")
278278
);
279279

280280

0 commit comments

Comments
 (0)