mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 03:51:29 +00:00
1123df7432
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
24 lines
617 B
Go
24 lines
617 B
Go
package blockchain
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
|
)
|
|
|
|
// SendNewBlobEvent sends a message to the BlobNotifier channel that the blob
|
|
// for the blocroot `root` is ready in the database
|
|
func (s *Service) sendNewBlobEvent(root [32]byte, index uint64) {
|
|
s.blobNotifiers.notifyIndex(root, index)
|
|
}
|
|
|
|
// ReceiveBlob saves the blob to database and sends the new event
|
|
func (s *Service) ReceiveBlob(ctx context.Context, b blocks.VerifiedROBlob) error {
|
|
if err := s.blobStorage.Save(b); err != nil {
|
|
return err
|
|
}
|
|
|
|
s.sendNewBlobEvent(b.BlockRoot(), b.Index)
|
|
return nil
|
|
}
|