MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / recobject

Method recobject

src/class_receiveDataThread.py:486–501  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

484
485
486 def recobject(self, data):
487 self.messageProcessingStartTime = time.time()
488 lengthOfTimeWeShouldUseToProcessThisMessage = shared.checkAndShareObjectWithPeers(data)
489 self.downloadQueue.task_done(calculateInventoryHash(data))
490
491 """
492 Sleeping will help guarantee that we can process messages faster than a
493 remote node can send them. If we fall behind, the attacker could observe
494 that we are are slowing down the rate at which we request objects from the
495 network which would indicate that we own a particular address (whichever
496 one to which they are sending all of their attack messages). Note
497 that if an attacker connects to a target with many connections, this
498 mitigation mechanism might not be sufficient.
499 """
500 sleepTime = lengthOfTimeWeShouldUseToProcessThisMessage - (time.time() - self.messageProcessingStartTime)
501 self._sleepForTimingAttackMitigation(sleepTime)
502
503
504 # We have received an inv message

Callers 1

processDataMethod · 0.95

Calls 3

calculateInventoryHashFunction · 0.85
task_doneMethod · 0.80

Tested by

no test coverage detected