2017-01-12 06:58:35 +01:00
|
|
|
import collections
|
|
|
|
|
2017-01-11 14:27:19 +01:00
|
|
|
neededPubkeys = {}
|
2017-01-11 17:00:00 +01:00
|
|
|
streamsInWhichIAmParticipating = {}
|
|
|
|
sendDataQueues = [] #each sendData thread puts its queue in this list.
|
2017-01-11 14:27:19 +01:00
|
|
|
|
|
|
|
# For UPnP
|
|
|
|
extPort = None
|
|
|
|
|
|
|
|
# for Tor hidden service
|
|
|
|
socksIP = None
|
2017-01-11 17:00:00 +01:00
|
|
|
|
2017-01-12 19:18:56 +01:00
|
|
|
# Network protocols availability, initialised below
|
|
|
|
networkProtocolAvailability = None
|
2017-01-11 17:00:00 +01:00
|
|
|
|
|
|
|
appdata = '' #holds the location of the application data storage directory
|
2017-01-12 06:58:35 +01:00
|
|
|
|
2017-01-14 23:20:15 +01:00
|
|
|
shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof of work worker threads to exit.
|
|
|
|
|
2017-01-12 06:58:35 +01:00
|
|
|
# If the trustedpeer option is specified in keys.dat then this will
|
|
|
|
# contain a Peer which will be connected to instead of using the
|
|
|
|
# addresses advertised by other peers. The client will only connect to
|
|
|
|
# this peer and the timing attack mitigation will be disabled in order
|
|
|
|
# to download data faster. The expected use case is where the user has
|
|
|
|
# a fast connection to a trusted server where they run a BitMessage
|
|
|
|
# daemon permanently. If they then run a second instance of the client
|
|
|
|
# on a local machine periodically when they want to check for messages
|
|
|
|
# it will sync with the network a lot faster without compromising
|
|
|
|
# security.
|
|
|
|
trustedPeer = None
|
|
|
|
|
|
|
|
Peer = collections.namedtuple('Peer', ['host', 'port'])
|
2017-01-12 19:18:56 +01:00
|
|
|
|
|
|
|
def resetNetworkProtocolAvailability():
|
|
|
|
global networkProtocolAvailability
|
|
|
|
networkProtocolAvailability = {'IPv4': None, 'IPv6': None, 'onion': None}
|
|
|
|
|
|
|
|
resetNetworkProtocolAvailability()
|