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

Commit b8b2e26

Browse files
Jan Xiekonradkonrad
authored andcommitted
make sure snapshot is valid
1 parent 60143a9 commit b8b2e26

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ethereum/snapshot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def get_ancestor_list(self, n):
4444

4545
def create_snapshot(chain, recent=1024):
4646
env = chain.env
47+
assert recent > env.config['MAX_UNCLE_DEPTH']+2
48+
4749
head_block = chain.head
4850
base_block_hash = chain.index.get_block_by_number(max(head_block.number-recent, 0))
4951
base_block = chain.get(base_block_hash)
@@ -197,4 +199,4 @@ def snapshot_form(val):
197199
if is_numeric(val):
198200
return str(val)
199201
elif is_string(val):
200-
return b'0x' + encode_hex(val)
202+
return b'0x' + encode_hex(val)

0 commit comments

Comments
 (0)