From 27eea3070f0475aeb7b09419523eecbe9aaf917b Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Sat, 30 Mar 2013 15:56:01 -0400 Subject: [PATCH] display message when objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave reaches 0 --- bitmessagemain.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index c33d8053..e280b868 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -7,7 +7,7 @@ #Right now, PyBitmessage only support connecting to stream 1. It doesn't yet contain logic to expand into further streams. softwareVersion = '0.2.7' -verbose = 2 +verbose = 1 maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 #Equals two days and 12 hours. lengthOfTimeToLeaveObjectsInInventory = 237600 #Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice. lengthOfTimeToHoldOnToAllPubkeys = 2419200 #Equals 4 weeks. You could make this longer if you want but making it shorter would not be advisable because there is a very small possibility that it could keep you from obtaining a needed pubkey for a period of time. @@ -369,7 +369,7 @@ class receiveDataThread(QThread): printLock.release() del self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave[objectHash] elif isInSqlInventory(objectHash): - if verbose >= 2: + if verbose >= 3: printLock.acquire() print 'Inventory (SQL on disk) already has object listed in inv message.' printLock.release() @@ -377,7 +377,15 @@ class receiveDataThread(QThread): else: self.sendgetdata(objectHash) del self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave[objectHash] #It is possible that the remote node doesn't respond with the object. In that case, we'll very likely get it from someone else anyway. + if len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave) == 0: + printLock.acquire() + print 'within processData, number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now', len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave) + printLock.release() break + if len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave) == 0: + printLock.acquire() + print 'within processData, number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now', len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave) + printLock.release() if len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave) > 0: printLock.acquire() print 'within processData, number of objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave is now', len(self.objectsThatWeHaveYetToCheckAndSeeWhetherWeAlreadyHave)