2019-09-20 13:19:04 +02:00
|
|
|
"""
|
|
|
|
src/state.py
|
|
|
|
=================================
|
|
|
|
"""
|
2017-01-12 06:58:35 +01:00
|
|
|
import collections
|
|
|
|
|
2017-01-11 14:27:19 +01:00
|
|
|
neededPubkeys = {}
|
2017-02-06 17:47:05 +01:00
|
|
|
streamsInWhichIAmParticipating = []
|
2017-01-11 14:27:19 +01:00
|
|
|
# For UPnP
|
|
|
|
extPort = None
|
|
|
|
# for Tor hidden service
|
|
|
|
socksIP = None
|
2019-09-20 13:19:04 +02:00
|
|
|
# Network protocols availability, initialised below
|
|
|
|
networkProtocolAvailability = None
|
2018-04-18 12:34:12 +02:00
|
|
|
appdata = '' # holds the location of the application data storage directory
|
|
|
|
# Set to 1 by the doCleanShutdown function.
|
|
|
|
# Used to tell the proof of work worker threads to exit.
|
|
|
|
shutdown = 0
|
2018-04-09 06:38:48 +02:00
|
|
|
# Component control flags - set on startup, do not change during runtime
|
|
|
|
# The defaults are for standalone GUI (default operating mode)
|
2018-04-18 12:34:12 +02:00
|
|
|
enableNetwork = True # enable network threads
|
|
|
|
enableObjProc = True # enable object processing threads
|
|
|
|
enableAPI = True # enable API (if configured)
|
|
|
|
enableGUI = True # enable GUI (QT or ncurses)
|
|
|
|
enableSTDIO = False # enable STDIO threads
|
2017-02-02 15:48:56 +01:00
|
|
|
curses = False
|
2018-04-18 12:34:12 +02:00
|
|
|
sqlReady = False # set to true by sqlTread when ready for processing
|
2017-05-25 23:04:33 +02:00
|
|
|
maximumNumberOfHalfOpenConnections = 0
|
2017-05-29 00:24:07 +02:00
|
|
|
invThread = None
|
2017-07-05 08:57:44 +02:00
|
|
|
addrThread = None
|
2017-07-05 09:25:49 +02:00
|
|
|
downloadThread = None
|
2018-12-18 22:47:34 +01:00
|
|
|
uploadThread = None
|
2017-05-31 00:04:21 +02:00
|
|
|
ownAddresses = {}
|
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
|
2017-08-06 21:29:54 +02:00
|
|
|
discoveredPeers = {}
|
2017-01-12 06:58:35 +01:00
|
|
|
Peer = collections.namedtuple('Peer', ['host', 'port'])
|
2017-01-12 19:18:56 +01:00
|
|
|
|
2019-09-20 13:19:04 +02:00
|
|
|
|
|
|
|
def resetNetworkProtocolAvailability():
|
|
|
|
"""This method helps to reset the availability of network protocol"""
|
|
|
|
# pylint: disable=global-statement
|
|
|
|
global networkProtocolAvailability
|
|
|
|
networkProtocolAvailability = {'IPv4': None, 'IPv6': None, 'onion': None}
|
|
|
|
|
|
|
|
|
|
|
|
resetNetworkProtocolAvailability()
|
|
|
|
|
2018-02-03 11:46:39 +01:00
|
|
|
dandelion = 0
|
2018-04-05 11:50:34 +02:00
|
|
|
|
|
|
|
testmode = False
|
2018-07-05 15:37:16 +02:00
|
|
|
|
|
|
|
kivy = False
|
2018-09-04 14:44:28 +02:00
|
|
|
|
|
|
|
association = ''
|
2019-05-09 14:48:29 +02:00
|
|
|
|
|
|
|
kivyapp = None
|
|
|
|
|
2019-05-28 13:12:51 +02:00
|
|
|
navinstance = None
|
|
|
|
|
|
|
|
sentMailTime = 0
|
|
|
|
|
2019-06-06 15:48:20 +02:00
|
|
|
myAddressObj = None
|
2019-05-28 13:12:51 +02:00
|
|
|
|
2019-06-06 15:48:20 +02:00
|
|
|
detailPageType = None
|
|
|
|
|
|
|
|
ackdata = None
|
|
|
|
|
2019-06-28 16:54:47 +02:00
|
|
|
status = None
|
|
|
|
|
|
|
|
screen_density = None
|
|
|
|
|
|
|
|
msg_counter_objs = None
|
|
|
|
|
|
|
|
check_sent_acc = None
|
|
|
|
|
|
|
|
sent_count = 0
|
|
|
|
|
|
|
|
inbox_count = 0
|
|
|
|
|
2019-07-17 10:50:27 +02:00
|
|
|
trash_count = 0
|
|
|
|
|
2019-08-02 11:11:33 +02:00
|
|
|
draft_count = 0
|
|
|
|
|
2019-08-14 16:55:34 +02:00
|
|
|
all_count = 0
|
|
|
|
|
2019-08-02 11:11:33 +02:00
|
|
|
searcing_text = ''
|
|
|
|
|
2019-08-19 13:06:24 +02:00
|
|
|
search_screen = ''
|
|
|
|
|
2019-08-26 17:28:12 +02:00
|
|
|
send_draft_mail = None
|
|
|
|
|
2019-09-11 17:03:51 +02:00
|
|
|
is_allmail = False
|
|
|
|
|
|
|
|
in_composer = False
|
|
|
|
|
2019-09-16 12:21:05 +02:00
|
|
|
write_msg = {}
|
|
|
|
|
2019-09-17 15:38:05 +02:00
|
|
|
availabe_credit = 0
|