protocol: replace missing state.extPort by 'extport' setting
Fixes #1497
This commit is contained in:
parent
c5ce2e36d5
commit
ea5c447ea4
|
@ -276,14 +276,18 @@ def assembleVersionMessage(remoteHost, remotePort, participatingStreams, server=
|
||||||
)
|
)
|
||||||
# = 127.0.0.1. This will be ignored by the remote host. The actual remote connected IP will be used.
|
# = 127.0.0.1. This will be ignored by the remote host. The actual remote connected IP will be used.
|
||||||
payload += '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF' + pack('>L', 2130706433)
|
payload += '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF' + pack('>L', 2130706433)
|
||||||
# we have a separate extPort and incoming over clearnet or outgoing through clearnet
|
# we have a separate extPort and incoming over clearnet
|
||||||
if BMConfigParser().safeGetBoolean('bitmessagesettings', 'upnp') and state.extPort \
|
# or outgoing through clearnet
|
||||||
and ((server and not checkSocksIP(remoteHost)) or
|
extport = BMConfigParser().safeGetInt('bitmessagesettings', 'extport')
|
||||||
(BMConfigParser().get("bitmessagesettings", "socksproxytype") == "none" and not server)):
|
if (
|
||||||
payload += pack('>H', state.extPort)
|
extport and ((server and not checkSocksIP(remoteHost)) or (
|
||||||
|
BMConfigParser().get('bitmessagesettings', 'socksproxytype') ==
|
||||||
|
'none' and not server))
|
||||||
|
):
|
||||||
|
payload += pack('>H', extport)
|
||||||
elif checkSocksIP(remoteHost) and server: # incoming connection over Tor
|
elif checkSocksIP(remoteHost) and server: # incoming connection over Tor
|
||||||
payload += pack('>H', BMConfigParser().getint('bitmessagesettings', 'onionport'))
|
payload += pack('>H', BMConfigParser().getint('bitmessagesettings', 'onionport'))
|
||||||
else: # no extPort and not incoming over Tor
|
else: # no extport and not incoming over Tor
|
||||||
payload += pack('>H', BMConfigParser().getint('bitmessagesettings', 'port'))
|
payload += pack('>H', BMConfigParser().getint('bitmessagesettings', 'port'))
|
||||||
|
|
||||||
random.seed()
|
random.seed()
|
||||||
|
|
Reference in New Issue
Block a user