Skip to content

Commit 334e27e

Browse files
hebastofanquake
authored andcommitted
util: Filter out macOS process serial number
Github-Pull: bitcoin#17184 Rebased-From: b5f0be3
1 parent e1bacb5 commit 334e27e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/util/system.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,15 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
380380

381381
for (int i = 1; i < argc; i++) {
382382
std::string key(argv[i]);
383+
384+
#ifdef MAC_OSX
385+
// At the first time when a user gets the "App downloaded from the
386+
// internet" warning, and clicks the Open button, macOS passes
387+
// a unique process serial number (PSN) as -psn_... command-line
388+
// argument, which we filter out.
389+
if (key.substr(0, 5) == "-psn_") continue;
390+
#endif
391+
383392
if (key == "-") break; //bitcoin-tx using stdin
384393
std::string val;
385394
size_t is_index = key.find('=');

0 commit comments

Comments
 (0)