Merge pull request #1492 from terencechain/patch-91

Remove duplicated attestation target root check
This commit is contained in:
Danny Ryan 2019-12-04 11:49:08 -07:00 committed by GitHub
commit e9dc2a1f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -251,8 +251,6 @@ def on_attestation(store: Store, attestation: Attestation) -> None:
# Use GENESIS_EPOCH for previous when genesis to avoid underflow # Use GENESIS_EPOCH for previous when genesis to avoid underflow
previous_epoch = current_epoch - 1 if current_epoch > GENESIS_EPOCH else GENESIS_EPOCH previous_epoch = current_epoch - 1 if current_epoch > GENESIS_EPOCH else GENESIS_EPOCH
assert target.epoch in [current_epoch, previous_epoch] assert target.epoch in [current_epoch, previous_epoch]
# Cannot calculate the current shuffling if have not seen the target
assert target.root in store.blocks
# Attestations target be for a known block. If target block is unknown, delay consideration until the block is found # Attestations target be for a known block. If target block is unknown, delay consideration until the block is found
assert target.root in store.blocks assert target.root in store.blocks