@ -1772,8 +1772,15 @@ class receiveDataThread(threading.Thread):
ifneedToWriteKnownNodesToDisk:# Runs if any nodes were new to us. Also, share those nodes with our peers.
shared.knownNodesLock.acquire()
output=open(shared.appdata+'knownnodes.dat','wb')
pickle.dump(shared.knownNodes,output)
output.close()
try:
pickle.dump(shared.knownNodes,output)
output.close()
exceptExceptionaserr:
if"Errno 28"instr(err):
logger.fatal('(while receiveDataThread needToWriteKnownNodesToDisk) Alert: Your disk or data storage volume is full. ')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
@ -230,7 +231,15 @@ class sqlThread(threading.Thread):
logger.fatal('PyBitmessage will now exit very abruptly. You may now see threading errors related to this abrupt exit but the problem you need to solve is related to SQLite.\n\n')
os._exit(0)
exceptExceptionaserr:
logger.error(err)
ifstr(err)=='database or disk is full':
logger.fatal('(While null value test) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
ifshared.daemon:
os._exit(0)
else:
return
else:
logger.error(err)
# Let us check to see the last time we vaccumed the messages.dat file.
# If it has been more than a month let's do it now.
@ -242,7 +251,16 @@ class sqlThread(threading.Thread):
value,=row
ifint(value)<int(time.time())-2592000:
logger.info('It has been a long time since the messages.dat file has been vacuumed. Vacuuming now...')
self.cur.execute(''' VACUUM ''')
try:
self.cur.execute(''' VACUUM ''')
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(While VACUUM) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
ifshared.daemon:
os._exit(0)
else:
return
item='''update settings set value=? WHERE key='lastvacuumtime';'''
parameters=(int(time.time()),)
self.cur.execute(item,parameters)
@ -250,7 +268,16 @@ class sqlThread(threading.Thread):
whileTrue:
item=shared.sqlSubmitQueue.get()
ifitem=='commit':
self.conn.commit()
try:
self.conn.commit()
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(While committing) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
ifshared.daemon:
os._exit(0)
else:
return
elifitem=='exit':
self.conn.close()
logger.info('sqlThread exiting gracefully.')
@ -259,7 +286,16 @@ class sqlThread(threading.Thread):
elifitem=='movemessagstoprog':
logger.debug('the sqlThread is moving the messages.dat file to the local program directory.')
self.conn.commit()
try:
self.conn.commit()
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while movemessagstoprog) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
@ -269,7 +305,16 @@ class sqlThread(threading.Thread):
elifitem=='movemessagstoappdata':
logger.debug('the sqlThread is moving the messages.dat file to the Appdata folder.')
self.conn.commit()
try:
self.conn.commit()
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while movemessagstoappdata) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
@ -280,7 +325,16 @@ class sqlThread(threading.Thread):
self.cur.execute('''delete from inbox where folder='trash'''')
self.cur.execute('''delete from sent where folder='trash'''')
self.conn.commit()
self.cur.execute(''' VACUUM ''')
try:
self.cur.execute(''' VACUUM ''')
exceptExceptionaserr:
ifstr(err)=='database or disk is full':
logger.fatal('(while deleteandvacuume) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
ifshared.daemon:
os._exit(0)
else:
return
else:
parameters=shared.sqlSubmitQueue.get()
# print 'item', item
@ -288,8 +342,16 @@ class sqlThread(threading.Thread):
try:
self.cur.execute(item,parameters)
exceptExceptionaserr:
logger.fatal('Major error occurred when trying to execute a SQL statement within the sqlThread. Please tell Atheros about this error message or post it in the forum! Error occurred while trying to execute statement: "%s" Here are the parameters; you might want to censor this data with asterisks (***) as it can contain private information: %s. Here is the actual error message thrown by the sqlThread: %s',str(item),str(repr(parameters)),str(err))
logger.fatal('This program shall now abruptly exit!')
ifstr(err)=='database or disk is full':
logger.fatal('(while cur.execute) Alert: Your disk or data storage volume is full. sqlThread will now exit.')
shared.UISignalQueue.put(('alert',(tr.translateText("MainWindow","Disk full"),tr.translateText("MainWindow",'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),True)))
ifshared.daemon:
os._exit(0)
else:
return
else:
logger.fatal('Major error occurred when trying to execute a SQL statement within the sqlThread. Please tell Atheros about this error message or post it in the forum! Error occurred while trying to execute statement: "%s" Here are the parameters; you might want to censor this data with asterisks (***) as it can contain private information: %s. Here is the actual error message thrown by the sqlThread: %s',str(item),str(repr(parameters)),str(err))
logger.fatal('This program shall now abruptly exit!')
#If changed, these values will cause particularly unexpected behavior: You won't be able to either send or receive messages because the proof of work you do (or demand) won't match that done or demanded by others. Don't change them!
networkDefaultProofOfWorkNonceTrialsPerByte=320#The amount of work that should be performed (and demanded) per byte of the payload. Double this number to double the work.