Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
Merge Wallet
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Boards
Labels
Milestones
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Merge
Merge Wallet
Commits
92349bc0
Commit
92349bc0
authored
Apr 14, 2019
by
barrystyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cherrypicked ipv6 fixes from pivx (
https://github.com/PIVX-Project/PIVX/pull/542
)
parent
df06a794
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
15 deletions
+5
-15
src/init.cpp
src/init.cpp
+4
-3
src/net.cpp
src/net.cpp
+1
-11
src/net.h
src/net.h
+0
-1
No files found.
src/init.cpp
View file @
92349bc0
...
...
@@ -1165,6 +1165,7 @@ bool AppInit2(boost::thread_group& threadGroup)
// -proxy sets a proxy for all outgoing network traffic
// -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default
std
::
string
proxyArg
=
GetArg
(
"-proxy"
,
""
);
SetLimited
(
NET_TOR
);
if
(
proxyArg
!=
""
&&
proxyArg
!=
"0"
)
{
CService
proxyAddr
;
if
(
!
Lookup
(
proxyArg
.
c_str
(),
proxyAddr
,
9050
,
fNameLookup
))
{
...
...
@@ -1179,7 +1180,7 @@ bool AppInit2(boost::thread_group& threadGroup)
SetProxy
(
NET_IPV6
,
addrProxy
);
SetProxy
(
NET_TOR
,
addrProxy
);
SetNameProxy
(
addrProxy
);
Set
Reachable
(
NET_TOR
);
// by default, -proxy sets onion as reachable, unless -noonion later
Set
Limited
(
NET_TOR
,
false
);
// by default, -proxy sets onion as reachable, unless -noonion later
}
// -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses
...
...
@@ -1188,7 +1189,7 @@ bool AppInit2(boost::thread_group& threadGroup)
std
::
string
onionArg
=
GetArg
(
"-onion"
,
""
);
if
(
onionArg
!=
""
)
{
if
(
onionArg
==
"0"
)
{
// Handle -noonion/-onion=0
Set
Reachable
(
NET_TOR
,
false
);
// set onions as unreachable
Set
Limited
(
NET_TOR
);
// set onions as unreachable
}
else
{
CService
onionProxy
;
if
(
!
Lookup
(
onionArg
.
c_str
(),
onionProxy
,
9050
,
fNameLookup
))
{
...
...
@@ -1198,7 +1199,7 @@ bool AppInit2(boost::thread_group& threadGroup)
if
(
!
addrOnion
.
IsValid
())
return
InitError
(
strprintf
(
_
(
"Invalid -onion address or hostname: '%s'"
),
onionArg
));
SetProxy
(
NET_TOR
,
addrOnion
);
Set
Reachable
(
NET_TOR
);
Set
Limited
(
NET_TOR
,
false
);
}
}
...
...
src/net.cpp
View file @
92349bc0
...
...
@@ -78,7 +78,6 @@ bool fListen = true;
uint64_t
nLocalServices
=
NODE_NETWORK
;
CCriticalSection
cs_mapLocalHost
;
map
<
CNetAddr
,
LocalServiceInfo
>
mapLocalHost
;
static
bool
vfReachable
[
NET_MAX
]
=
{};
static
bool
vfLimited
[
NET_MAX
]
=
{};
static
CNode
*
pnodeLocalHost
=
NULL
;
uint64_t
nLocalHostNonce
=
0
;
...
...
@@ -238,14 +237,6 @@ void AdvertizeLocal(CNode* pnode)
}
}
void
SetReachable
(
enum
Network
net
,
bool
fFlag
)
{
LOCK
(
cs_mapLocalHost
);
vfReachable
[
net
]
=
fFlag
;
if
(
net
==
NET_IPV6
&&
fFlag
)
vfReachable
[
NET_IPV4
]
=
true
;
}
// learn a new local address
bool
AddLocal
(
const
CService
&
addr
,
int
nScore
)
{
...
...
@@ -268,7 +259,6 @@ bool AddLocal(const CService& addr, int nScore)
info
.
nScore
=
nScore
+
(
fAlready
?
1
:
0
);
info
.
nPort
=
addr
.
GetPort
();
}
SetReachable
(
addr
.
GetNetwork
());
}
return
true
;
...
...
@@ -331,7 +321,7 @@ bool IsLocal(const CService& addr)
bool
IsReachable
(
enum
Network
net
)
{
LOCK
(
cs_mapLocalHost
);
return
vfReachable
[
net
]
&&
!
vfLimited
[
net
];
return
!
vfLimited
[
net
];
}
/** check whether a given address is in a network we can probably connect to */
...
...
src/net.h
View file @
92349bc0
...
...
@@ -118,7 +118,6 @@ bool IsLocal(const CService& addr);
bool
GetLocal
(
CService
&
addr
,
const
CNetAddr
*
paddrPeer
=
NULL
);
bool
IsReachable
(
enum
Network
net
);
bool
IsReachable
(
const
CNetAddr
&
addr
);
void
SetReachable
(
enum
Network
net
,
bool
fFlag
=
true
);
CAddress
GetLocalAddress
(
const
CNetAddr
*
paddrPeer
=
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment