Improve merkle proof and tx cache performance #29
1 changed files with 1 additions and 2 deletions
|
@ -279,10 +279,9 @@ class MerkleCache:
|
||||||
|
|
||||||
|
|
||||||
class FastMerkleCacheItem:
|
class FastMerkleCacheItem:
|
||||||
__slots__ = ['tx_hashes', 'tree', 'root_hash']
|
__slots__ = ['tree', 'root_hash']
|
||||||
|
|
||||||
def __init__(self, tx_hashes: typing.List[bytes]):
|
def __init__(self, tx_hashes: typing.List[bytes]):
|
||||||
self.tx_hashes = tuple(tx_hashes)
|
|
||||||
self.tree: typing.List[typing.List[bytes]] = []
|
self.tree: typing.List[typing.List[bytes]] = []
|
||||||
self.root_hash = self._walk_merkle(tx_hashes, self.tree.append)
|
self.root_hash = self._walk_merkle(tx_hashes, self.tree.append)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue