mirror of
https://github.com/status-im/go-waku.git
synced 2025-02-04 18:03:33 +00:00
fix: return error in relay publish if exceeding max-msg-size (#939)
This commit is contained in:
parent
ac1a699171
commit
6bd85a1dc9
@ -43,7 +43,7 @@ func NewMetricsServer(address string, port int, log *zap.Logger) *Server {
|
||||
|
||||
// Start executes the HTTP server in the background.
|
||||
func (p *Server) Start() {
|
||||
p.log.Info("server stopped ", zap.Error(p.server.ListenAndServe()))
|
||||
p.log.Info("server started ", zap.Error(p.server.ListenAndServe()))
|
||||
}
|
||||
|
||||
// Stop shuts down the prometheus server
|
||||
|
@ -289,6 +289,10 @@ func (w *WakuRelay) Publish(ctx context.Context, message *pb.WakuMessage, opts .
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(out) > pubsub.DefaultMaxMessageSize {
|
||||
return nil, errors.New("message size exceeds gossipsub max message size")
|
||||
}
|
||||
|
||||
err = pubSubTopic.Publish(ctx, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user