@ -391,7 +391,7 @@ class receiveDataThread(threading.Thread):
print'(concerning',self.HOST+')','number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)
delnumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHavePerPeer[self.HOST]#this data structure is maintained so that we can keep track of how many total objects, across all connections, are currently outstanding. If it goes too high it can indicate that we are under attack by multiple nodes working together.
except:
pass
break
@ -400,14 +400,14 @@ class receiveDataThread(threading.Thread):
print'(concerning',self.HOST+')','number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)
delnumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHavePerPeer[self.HOST]#this data structure is maintained so that we can keep track of how many total objects, across all connections, are currently outstanding. If it goes too high it can indicate that we are under attack by multiple nodes working together.
print'(concerning',self.HOST+')','number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)
numberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHavePerPeer[self.HOST]=len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)#this data structure is maintained so that we can keep track of how many total objects, across all connections, are currently outstanding. If it goes too high it can indicate that we are under attack by multiple nodes working together.
iflen(self.ackDataThatWeHaveYetToSend)>0:
self.data=self.ackDataThatWeHaveYetToSend.pop()
self.processData()
@ -1507,17 +1507,12 @@ class receiveDataThread(threading.Thread):
print'We already have',totalNumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave,'items yet to retrieve from peers. Ignoring this inv message.'
print'We already have',totalNumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave,'items yet to retrieve from peers and over 1000 from this node in particular. Ignoring this inv message.'
shared.printLock.release()
@ -1535,7 +1530,7 @@ class receiveDataThread(threading.Thread):
foriinrange(numberOfItemsInInv):#upon finishing dealing with an incoming message, the receiveDataThread will request a random object from the peer. This way if we get multiple inv messages from multiple peers which list mostly the same objects, we will make getdata requests for different random objects from the various peers.
iflen(data[lengthOfVarint+(32*i):32+lengthOfVarint+(32*i)])==32:#The length of an inventory hash should be 32. If it isn't 32 then the remote node is either badly programmed or behaving nefariously.
print'We already have',totalNumberOfObjectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave,'items yet to retrieve from peers and over',len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave),'from this node in particular. Ignoring the rest of this inv message.'
@ -768,6 +769,21 @@ class MyForm(QtGui.QMainWindow):
ifreply==QtGui.QMessageBox.Yes:
self.openKeysFile()
defclick_actionDeleteAllTrashedMessages(self):
ifQtGui.QMessageBox.question(self,'Delete trash?',"Are you sure you want to delete all trashed messages?",QtGui.QMessageBox.Yes,QtGui.QMessageBox.No)==QtGui.QMessageBox.No:
return
shared.sqlLock.acquire()
shared.sqlSubmitQueue.put('''delete from inbox where folder='trash'''')
shared.sqlSubmitQueue.put('')
shared.sqlReturnQueue.get()
shared.sqlSubmitQueue.put('''delete from sent where folder='trash'''')
shared.sqlSubmitQueue.put('')
shared.sqlReturnQueue.get()
shared.sqlSubmitQueue.put('commit')#Commit takes no parameters
#This function exists because of the API. The API thread starts an address generator thread and must somehow connect the address generator's signals to the QApplication thread. This function is used to connect the slots and signals.
#This function is called by the processmsg function when that function receives a message to an address that is acting as a pseudo-mailing-list. The message will be broadcast out. This function puts the message on the 'Sent' tab.
self.actionDeleteAllTrashedMessages.setText(QtGui.QApplication.translate("MainWindow","Delete all trashed messages",None,QtGui.QApplication.UnicodeUTF8))