(self, data)
| 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 |
no test coverage detected