mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
19 lines
529 B
Go
19 lines
529 B
Go
package sync
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogo/protobuf/proto"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
|
)
|
|
|
|
// beaconAttestationSubscriber forwards the incoming validated attestation to the blockchain
|
|
// service for processing.
|
|
func (r *RegularSync) beaconAttestationSubscriber(ctx context.Context, msg proto.Message) error {
|
|
if err := r.operations.HandleAttestation(ctx, msg.(*ethpb.Attestation)); err != nil {
|
|
return err
|
|
}
|
|
|
|
return r.chain.ReceiveAttestationNoPubsub(ctx, msg.(*ethpb.Attestation))
|
|
}
|