This commit is contained in:
cheatfate 2021-04-12 17:30:32 +03:00 committed by zah
parent 498c998552
commit 477decbcf5
1 changed files with 5 additions and 11 deletions

View File

@ -274,17 +274,11 @@ iterator attestations*(pool: AttestationPool, slot: Option[Slot],
index: Option[CommitteeIndex]): Attestation = index: Option[CommitteeIndex]): Attestation =
for seenAttestations in pool.candidates.items(): for seenAttestations in pool.candidates.items():
for entry in seenAttestations.attestations.items(): for entry in seenAttestations.attestations.items():
let slotInclude = let includeFlag =
if slot.isSome(): (slot.isNone() and index.isNone()) or
entry.data.slot == slot.get() (slot.isSome() and (entry.data.slot == slot.get())) or
else: (index.isSome() and (CommitteeIndex(entry.data.index) == index.get()))
true if includeFlag:
let committeeInclude =
if index.isSome():
CommitteeIndex(entry.data.index) == index.get()
else:
true
if slotInclude or committeeInclude:
for validation in entry.validations.items(): for validation in entry.validations.items():
yield Attestation( yield Attestation(
aggregation_bits: validation.aggregation_bits, aggregation_bits: validation.aggregation_bits,