2019-08-23 19:46:04 +00:00
|
|
|
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 {
|
2019-08-28 03:19:47 +00:00
|
|
|
if err := r.operations.HandleAttestation(ctx, msg.(*ethpb.Attestation)); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-08-23 19:46:04 +00:00
|
|
|
return r.chain.ReceiveAttestationNoPubsub(ctx, msg.(*ethpb.Attestation))
|
|
|
|
}
|