MCPcopy Create free account
hub / github.com/ElementsProject/elements / wallet_shasum

Method wallet_shasum

test/functional/tool_wallet.py:53–59  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51 assert_equal(p.poll(), 0)
52
53 def wallet_shasum(self):
54 h = hashlib.sha1()
55 mv = memoryview(bytearray(BUFFER_SIZE))
56 with open(self.wallet_path, 'rb', buffering=0) as f:
57 for n in iter(lambda: f.readinto(mv), 0):
58 h.update(mv[:n])
59 return h.hexdigest()
60
61 def wallet_timestamp(self):
62 return os.path.getmtime(self.wallet_path)

Calls 1

updateMethod · 0.45