This commit is contained in:
Justin Drake 2019-05-01 08:45:29 +01:00
parent 2e5ab130c1
commit a6e76ef9c6
1 changed files with 4 additions and 2 deletions

View File

@ -1070,8 +1070,10 @@ def is_slashable_attestation_data(data_1: AttestationData, data_2: AttestationDa
Check if ``data_1`` and ``data_2`` are slashable according to Casper FFG rules. Check if ``data_1`` and ``data_2`` are slashable according to Casper FFG rules.
""" """
return ( return (
(data_1 != data_2 and data_1.target == data_2.target) or # Double vote # Double vote
(data_1.source < data_2.source and data_2.target < data_1.target) # Surround vote (data_1 != data_2 and data_1.target_epoch == data_2.target_epoch) or
# Surround vote
(data_1.source_epoch < data_2.source_epoch and data_2.target_epoch < data_1.target_epoch)
) )
``` ```