aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/misc.cpp4
-rw-r--r--src/rpc/util.cpp1
-rw-r--r--src/rpc/util.h6
3 files changed, 9 insertions, 2 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index f360cb7525..958c477e7e 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -42,8 +42,8 @@ static UniValue validateaddress(const JSONRPCRequest& request)
"}\n"
},
RPCExamples{
- HelpExampleCli("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
- + HelpExampleRpc("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")
+ HelpExampleCli("validateaddress", EXAMPLE_ADDRESS) +
+ HelpExampleRpc("validateaddress", EXAMPLE_ADDRESS)
},
}.Check(request);
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 78586c22f9..7cefb2db96 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -14,6 +14,7 @@
#include <tuple>
const std::string UNIX_EPOCH_TIME = "UNIX epoch time";
+const std::string EXAMPLE_ADDRESS = "\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\"";
void RPCTypeCheck(const UniValue& params,
const std::list<UniValueType>& typesExpected,
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 065a992a88..f5edf69713 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -28,6 +28,12 @@
*/
extern const std::string UNIX_EPOCH_TIME;
+/**
+ * Example bech32 address used in multiple RPCExamples. The address is intentionally
+ * invalid to prevent accidental transactions by users.
+ */
+extern const std::string EXAMPLE_ADDRESS;
+
class FillableSigningProvider;
class CPubKey;
class CScript;