util: Filter out macOS process serial number

Github-Pull: #17184
Rebased-From: b5f0be38790ecc87a1e537edeca5923f608bc68c
This commit is contained in:
Hennadii Stepanov 2019-10-18 09:12:15 +03:00 committed by fanquake
parent e1bacb591a
commit 334e27ed5a
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -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('=');