successfullyDecryptMessageTimings=[]#A list of the amounts of time it took to successfully decrypt msg messages
#apiSignalQueue = Queue.Queue() #The singleAPI thread uses this queue to pass messages to a QT thread which can emit signals to do things like display a message in the UI.
apiAddressGeneratorReturnQueue=Queue.Queue()#The address generator thread uses this queue to get information back to the API thread.
alreadyAttemptedConnectionsListResetTime=int(time.time())#used to clear out the alreadyAttemptedConnectionsList periodically so that we will retry connecting to hosts to which we have already tried to connect.
#Let us now see if we should move the messages.dat file. There is an option in the settings to switch 'Portable Mode' on or off. Most of the files are moved instantly, but the messages.dat file cannot be moved while it is open. Now that it is not open we can move it now!
@ -21,6 +21,7 @@ from time import strftime, localtime, gmtime
importtime
importos
frompyelliptic.opensslimportOpenSSL
importpickle
classMyForm(QtGui.QMainWindow):
def__init__(self,parent=None):
@ -1150,8 +1151,10 @@ class MyForm(QtGui.QMainWindow):
pass
ifshared.appdata!=''andself.settingsDialogInstance.ui.checkBoxPortableMode.isChecked():#If we are NOT using portable mode now but the user selected that we should...
shared.config.set('bitmessagesettings','movemessagstoprog','true')#Tells bitmessage to move the messages.dat file to the program directory the next time the program starts.
#Write the keys.dat file to disk in the new location
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put('movemessagstoprog')
shared.sqlLock.release()
withopen('keys.dat','wb')asconfigfile:
shared.config.write(configfile)
#Write the knownnodes.dat file to disk in the new location
@ -1163,13 +1166,14 @@ class MyForm(QtGui.QMainWindow):
os.remove(shared.appdata+'keys.dat')
os.remove(shared.appdata+'knownnodes.dat')
shared.appdata=''
QMessageBox.about(self,"Restart","Bitmessage has moved most of your config files to the program directory but you must restart Bitmessage to move the last file (the file which holds messages).")
ifshared.appdata==''andnotself.settingsDialogInstance.ui.checkBoxPortableMode.isChecked():#If we ARE using portable mode now but the user selected that we shouldn't...
shared.appdata=shared.lookupAppdataFolder()
ifnotos.path.exists(shared.appdata):
os.makedirs(shared.appdata)
shared.config.set('bitmessagesettings','movemessagstoappdata','true')#Tells bitmessage to move the messages.dat file to the appdata directory the next time the program starts.
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put('movemessagstoappdata')
shared.sqlLock.release()
#Write the keys.dat file to disk in the new location
@ -1181,7 +1185,6 @@ class MyForm(QtGui.QMainWindow):
shared.knownNodesLock.release()
os.remove('keys.dat')
os.remove('knownnodes.dat')
QMessageBox.about(self,"Restart","Bitmessage has moved most of your config files to the application data directory but you must restart Bitmessage to move the last file (the file which holds messages).")