bitcoin/src/common
Vasil Dimov 856c88776f ArgsManager: return path by value from GetBlocksDirPath()
`ArgsManager::m_cached_blocks_path` is protected by
`ArgsManager::cs_args` and returning a reference to it after releasing
the mutex is unsafe.

To resolve this, return a copy of the path. This has some performance
penalty which is presumably ok, given that paths are a few 100s bytes
at most and `GetBlocksDirPath()` is not called often.

This silences the following (clang 18):

```
common/args.cpp:288:31: error: returning variable 'm_cached_blocks_path' by reference requires holding mutex 'cs_args' [-Werror,-Wthread-safety-reference-return]
  288 |     if (!path.empty()) return path;
      |                               ^
```

Do the same with
`ArgsManager::GetDataDir()`,
`ArgsManager::GetDataDirBase()` and
`ArgsManager::GetDataDirNet()`.
2023-12-11 17:42:17 +01:00
..
args.cpp ArgsManager: return path by value from GetBlocksDirPath() 2023-12-11 17:42:17 +01:00
args.h ArgsManager: return path by value from GetBlocksDirPath() 2023-12-11 17:42:17 +01:00
bloom.cpp Use Txid in COutpoint 2023-11-21 13:15:44 +00:00
bloom.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
config.cpp scripted-diff: move settings to common namespace 2023-05-30 17:26:51 +02:00
init.cpp Merge bitcoin/bitcoin#27302: init: Error if ignored bitcoin.conf file is found 2023-05-26 13:33:42 +01:00
init.h Deduplicate bitcoind and bitcoin-qt init code 2023-02-28 12:04:47 -05:00
interfaces.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
run_command.cpp refactor: remove in-code warning suppression 2023-06-29 14:41:33 +01:00
run_command.h refactor: move run_command from util to common 2022-10-04 21:21:05 +00:00
settings.cpp scripted-diff: Following the C++ Standard rules for identifiers with _. 2023-06-20 10:23:08 +02:00
settings.h scripted-diff: move settings to common namespace 2023-05-30 17:26:51 +02:00
system.cpp Move compat.h include from system.h to system.cpp 2023-10-16 14:34:30 +02:00
system.h Merge bitcoin/bitcoin#28486: test, bench: Initialize and terminate use of Winsock properly 2023-11-29 17:14:34 +00:00
url.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
url.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00