MCPcopy Create free account
hub / github.com/Bitmessage/PyBitmessage / unexpired_hashes_by_stream

Method unexpired_hashes_by_stream

src/storage/sqlite.py:61–66  ·  view source on GitHub ↗
(self, stream)

Source from the content-addressed store, hash-verified

59 return values
60
61 def unexpired_hashes_by_stream(self, stream):
62 with self.lock:
63 t = int(time.time())
64 hashes = [x for x, value in self._inventory.items() if value.stream == stream and value.expires > t]
65 hashes += (str(payload) for payload, in sqlQuery('SELECT hash FROM inventory WHERE streamnumber=? AND expirestime>?', stream, t))
66 return hashes
67
68 def flush(self):
69 with self.lock: # If you use both the inventoryLock and the sqlLock, always use the inventoryLock OUTSIDE of the sqlLock.

Callers 2

sendBigInvMethod · 0.45
sendBigInvMethod · 0.45

Calls 2

sqlQueryFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected