aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-10-18 09:12:15 +0300
committerfanquake <fanquake@gmail.com>2019-10-19 14:04:29 -0400
commit334e27ed5aae2dbe767b73eac8876edf5ab2b797 (patch)
tree004652ee3ab46aabeb9484efc27206c2902e1dbb
parente1bacb591a75375461cdf9e39e4dda4acdbd6981 (diff)
downloadbitcoin-334e27ed5aae2dbe767b73eac8876edf5ab2b797.tar.xz
util: Filter out macOS process serial number
Github-Pull: #17184 Rebased-From: b5f0be38790ecc87a1e537edeca5923f608bc68c
-rw-r--r--src/util/system.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index f22256615f..3820006072 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -380,6 +380,15 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
for (int i = 1; i < argc; i++) {
std::string key(argv[i]);
+
+#ifdef MAC_OSX
+ // At the first time when a user gets the "App downloaded from the
+ // internet" warning, and clicks the Open button, macOS passes
+ // a unique process serial number (PSN) as -psn_... command-line
+ // argument, which we filter out.
+ if (key.substr(0, 5) == "-psn_") continue;
+#endif
+
if (key == "-") break; //bitcoin-tx using stdin
std::string val;
size_t is_index = key.find('=');