skip the slow message 'leaking' functionality if tens of messages are queued waiting to be sent
This commit is contained in:
parent
12f03fc891
commit
b8df5976eb
|
@ -1162,7 +1162,6 @@ class receiveDataThread(QThread):
|
||||||
printLock.release()
|
printLock.release()
|
||||||
return
|
return
|
||||||
if addressVersion == 2:
|
if addressVersion == 2:
|
||||||
print 'within recpubkey, the self.payloadLength is', self.payloadLength,'. It should be 146.'
|
|
||||||
if self.payloadLength < 146: #sanity check. This is the minimum possible length.
|
if self.payloadLength < 146: #sanity check. This is the minimum possible length.
|
||||||
print 'payloadLength less than 146. Sanity check failed.'
|
print 'payloadLength less than 146. Sanity check failed.'
|
||||||
return
|
return
|
||||||
|
@ -1819,7 +1818,8 @@ class sendDataThread(QThread):
|
||||||
self.streamNumber = specifiedStreamNumber
|
self.streamNumber = specifiedStreamNumber
|
||||||
elif command == 'send':
|
elif command == 'send':
|
||||||
try:
|
try:
|
||||||
#To prevent some network analysis, 'leak' the data out to our peer after waiting a random amount of time.
|
#To prevent some network analysis, 'leak' the data out to our peer after waiting a random amount of time unless we have a long list of messages in our queue to send.
|
||||||
|
if self.mailbox.qsize() < 20:
|
||||||
random.seed()
|
random.seed()
|
||||||
time.sleep(random.randrange(0, 10))
|
time.sleep(random.randrange(0, 10))
|
||||||
self.sock.sendall(data)
|
self.sock.sendall(data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user