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

Method handleReceivedObject

src/network/objectracker.py:86–107  ·  view source on GitHub ↗
(self, streamNumber, hashid)

Source from the content-addressed store, hash-verified

84 self.objectsNewToMe[hashId] = True
85
86 def handleReceivedObject(self, streamNumber, hashid):
87 for i in network.connectionpool.BMConnectionPool().inboundConnections.values() + network.connectionpool.BMConnectionPool().outboundConnections.values():
88 if not i.fullyEstablished:
89 continue
90 try:
91 del i.objectsNewToMe[hashid]
92 except KeyError:
93 if streamNumber in i.streams and \
94 (not Dandelion().hasHash(hashid) or \
95 Dandelion().objectChildStem(hashid) == i):
96 with i.objectsNewToThemLock:
97 i.objectsNewToThem[hashid] = time.time()
98 # update stream number, which we didn't have when we just received the dinv
99 # also resets expiration of the stem mode
100 Dandelion().setHashStream(hashid, streamNumber)
101
102 if i == self:
103 try:
104 with i.objectsNewToThemLock:
105 del i.objectsNewToThem[hashid]
106 except KeyError:
107 pass
108
109 def hasAddr(self, addr):
110 if haveBloom:

Callers 1

bm_command_objectMethod · 0.80

Calls 4

DandelionClass · 0.90
objectChildStemMethod · 0.80
setHashStreamMethod · 0.80
hasHashMethod · 0.45

Tested by

no test coverage detected