Skip to content

Commit afa71fb

Browse files
committed
Harmonize importprivkey and importaddress documentation
1 parent cdb4193 commit afa71fb

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/rpcdump.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,17 @@ Value importprivkey(const Array& params, bool fHelp)
7272
"\nAdds a private key (as returned by dumpprivkey) to your wallet.\n"
7373
"\nArguments:\n"
7474
"1. \"bitcoinprivkey\" (string, required) The private key (see dumpprivkey)\n"
75-
"2. \"label\" (string, optional) an optional label\n"
75+
"2. \"label\" (string, optional, default=\"\") An optional label\n"
7676
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
77+
"\nNote: This call can take minutes to complete if rescan is true.\n"
7778
"\nExamples:\n"
7879
"\nDump a private key\n"
7980
+ HelpExampleCli("dumpprivkey", "\"myaddress\"") +
80-
"\nImport the private key\n"
81+
"\nImport the private key with rescan\n"
8182
+ HelpExampleCli("importprivkey", "\"mykey\"") +
82-
"\nImport using a label\n"
83+
"\nImport using a label and without rescan\n"
8384
+ HelpExampleCli("importprivkey", "\"mykey\" \"testing\" false") +
84-
"\nAs a json rpc call\n"
85+
"\nAs a JSON-RPC call\n"
8586
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
8687
);
8788

@@ -137,8 +138,21 @@ Value importaddress(const Array& params, bool fHelp)
137138
{
138139
if (fHelp || params.size() < 1 || params.size() > 3)
139140
throw runtime_error(
140-
"importaddress <address> [label] [rescan=true]\n"
141-
"Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.");
141+
"importaddress \"address\" ( \"label\" rescan )\n"
142+
"\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.\n"
143+
"\nArguments:\n"
144+
"1. \"address\" (string, required) The address\n"
145+
"2. \"label\" (string, optional, default=\"\") An optional label\n"
146+
"3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n"
147+
"\nNote: This call can take minutes to complete if rescan is true.\n"
148+
"\nExamples:\n"
149+
"\nImport an address with rescan\n"
150+
+ HelpExampleCli("importaddress", "\"myaddress\"") +
151+
"\nImport using a label without rescan\n"
152+
+ HelpExampleCli("importaddress", "\"myaddress\" \"testing\" false") +
153+
"\nAs a JSON-RPC call\n"
154+
+ HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false")
155+
);
142156

143157
CScript script;
144158

0 commit comments

Comments
 (0)