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

Method add

src/inventory.py:113–127  ·  view source on GitHub ↗
(self, objectHash = None)

Source from the content-addressed store, hash-verified

111 self.lastCleared = time.time()
112
113 def add(self, objectHash = None):
114 with self.lock:
115 # add a new object into existing thread lists
116 if objectHash:
117 if objectHash not in self.hashes:
118 self.hashes[objectHash] = {'created': time.time(), 'sendCount': 0, 'peers': []}
119 for thread in threadingEnumerate():
120 if thread.isAlive() and hasattr(thread, 'peer') and \
121 thread.peer not in self.hashes[objectHash]['peers']:
122 self.hashes[objectHash]['peers'].append(thread.peer)
123 # add all objects into the current thread
124 else:
125 for objectHash in self.hashes:
126 if current_thread().peer not in self.hashes[objectHash]['peers']:
127 self.hashes[objectHash]['peers'].append(current_thread().peer)
128
129 def len(self):
130 self.clearHashes()

Callers 14

bloomfiltertest.pyFile · 0.80
apiTestFunction · 0.80
doPOWForMyV2PubkeyMethod · 0.80
sendBroadcastMethod · 0.80
sendMsgMethod · 0.80
requestPubKeyMethod · 0.80
recinvMethod · 0.80
api_client.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected