Skip to content

Commit

Permalink
feat: dispersePaidBlob disabled when unset
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Oct 29, 2024
1 parent d603716 commit c317303
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ func (s *DispersalServer) disperseBlob(ctx context.Context, blob *core.Blob, aut
}

func (s *DispersalServer) DispersePaidBlob(ctx context.Context, req *pb.DispersePaidBlobRequest) (*pb.DisperseBlobReply, error) {
// If EnablePaymentMeter is false, meterer gets set to nil at start
// In that case, the function should not continue. (checking )
if s.meterer == nil {
return nil, api.NewErrorInternal("payment feature is not enabled")
}
blob, err := s.validatePaidRequestAndGetBlob(ctx, req)
binIndex := req.PaymentHeader.BinIndex
cumulativePayment := new(big.Int).SetBytes(req.PaymentHeader.CumulativePayment)
Expand Down

0 comments on commit c317303

Please sign in to comment.