mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 14:47:31 +02:00
refactor: Return std::optional from GetProxy
This commit is contained in:
@@ -706,13 +706,14 @@ bool SetProxy(enum Network net, const Proxy &addrProxy) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetProxy(enum Network net, Proxy &proxyInfoOut) {
|
||||
std::optional<Proxy> GetProxy(enum Network net)
|
||||
{
|
||||
assert(net >= 0 && net < NET_MAX);
|
||||
LOCK(g_proxyinfo_mutex);
|
||||
if (!proxyInfo[net].IsValid())
|
||||
return false;
|
||||
proxyInfoOut = proxyInfo[net];
|
||||
return true;
|
||||
if (!proxyInfo[net].IsValid()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return proxyInfo[net];
|
||||
}
|
||||
|
||||
bool SetNameProxy(const Proxy &addrProxy) {
|
||||
|
||||
Reference in New Issue
Block a user