handle when no attestations availble for crosslinking (#717)
This commit is contained in:
parent
66105b01e4
commit
47cca60148
|
@ -2057,6 +2057,10 @@ def get_winning_root_and_participants(state: BeaconState, shard: Shard) -> Tuple
|
||||||
]
|
]
|
||||||
all_roots = [a.data.crosslink_data_root for a in valid_attestations]
|
all_roots = [a.data.crosslink_data_root for a in valid_attestations]
|
||||||
|
|
||||||
|
# handle when no attestations for shard available
|
||||||
|
if len(all_roots) == 0:
|
||||||
|
return ZERO_HASH, []
|
||||||
|
|
||||||
def get_attestations_for(root) -> List[PendingAttestation]:
|
def get_attestations_for(root) -> List[PendingAttestation]:
|
||||||
return [a for a in valid_attestations if a.data.crosslink_data_root == root]
|
return [a for a in valid_attestations if a.data.crosslink_data_root == root]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue