Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 4832acb

Browse files
vubvub
authored andcommitted
Added a get_bloom method for faster RPC querying
1 parent ab9079e commit 4832acb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ethereum/chain.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ def get(self, blockhash):
261261
assert len(blockhash) == 32
262262
return blocks.get_block(self.env, blockhash)
263263

264+
def get_bloom(self, blockhash):
265+
h = rlp.decode(rlp.descend(self.db.get(blockhash), 0, 6))
266+
return utils.big_endian_to_int(h)
267+
264268
def has_block(self, blockhash):
265269
assert is_string(blockhash)
266270
assert len(blockhash) == 32

0 commit comments

Comments
 (0)