func (am *attestationMempool) GetMempoolSummary() pb.GetAttestationMempoolMessage {
	am.attestationsLock.RLock()
	defer am.attestationsLock.RUnlock()

	summary := pb.GetAttestationMempoolMessage{
		Attestations: make([]*pb.AttestationMempoolItem, len(am.attestations)),
	}

	i := 0
	for h, atts := range am.attestations {
		if len(atts) == 0 {
			continue
		}

		participationBitfield := atts[0].ParticipationBitfield[:]

		for _, p := range atts[1:] {
			for i := range participationBitfield {
				participationBitfield[i] |= p.ParticipationBitfield[i]
			}
		}

		summary.Attestations[i] = &pb.AttestationMempoolItem{
			AttestationHash: h[:],
			Participation:   participationBitfield,
		}
		i++
	}

	return summary
}
// GetMempoolSummary gets a summary of the mempool so we can sync it with other peers.
GetMempoolSummary gets a summary of the mempool so we can sync it with other peers.
// GetMempoolSummary gets a summary of the mempool so we can sync it with other peers .
func (am *attestationMempool) GetMempoolSummary() pb.GetAttestationMempoolMessage {
	am.attestationsLock.RLock()
	defer am.attestationsLock.RUnlock()
	summary := pb.GetAttestationMempoolMessage{
		Attestations: make([]*pb.AttestationMempoolItem, len(am.attestations)),
	}
	i := 0
	for h, atts := range am.attestations {
		if len(atts) == 0 {
			continue
		}
		participationBitfield := atts[0].ParticipationBitfield[:]
		for _, p := range atts[1:] {
			for i := range participationBitfield {
				participationBitfield[i] |= p.ParticipationBitfield[i]
			}
		}
		summary.Attestations[i] = &pb.AttestationMempoolItem{
			AttestationHash: h[:],
			Participation:   participationBitfield,
		}
		i++
	}
	return summary
}
func ( am * attestationMempool ) GetMempoolSummary ( ) pb . GetAttestationMempoolMessage { am . attestationsLock . RLock ( ) defer am . attestationsLock . RUnlock ( ) summary := pb . GetAttestationMempoolMessage { Attestations : make ( [ ] * pb . AttestationMempoolItem , len ( am . attestations ) ) , } i := 0 for h , atts := range am . attestations { if len ( atts ) == 0 { continue } participationBitfield := atts [ 0 ] . ParticipationBitfield [ : ] for _ , p := range atts [ 1 : ] { for i := range participationBitfield { participationBitfield [ i ] |= p . ParticipationBitfield [ i ] } } summary . Attestations [ i ] = & pb . AttestationMempoolItem { AttestationHash : h [ : ] , Participation : participationBitfield , } i ++ } return summary }
GetMempoolSummary gets a summary of the mempool so we can sync it with other peers.
GetMempoolSummary gets a summary of the mempool so we can sync it with other peers .