mirror of
https://github.com/status-im/go-waku.git
synced 2025-02-13 14:06:35 +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.
|
// Start executes the HTTP server in the background.
|
||||||
func (p *Server) Start() {
|
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
|
// Stop shuts down the prometheus server
|
||||||
|
@ -289,6 +289,10 @@ func (w *WakuRelay) Publish(ctx context.Context, message *pb.WakuMessage, opts .
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(out) > pubsub.DefaultMaxMessageSize {
|
||||||
|
return nil, errors.New("message size exceeds gossipsub max message size")
|
||||||
|
}
|
||||||
|
|
||||||
err = pubSubTopic.Publish(ctx, out)
|
err = pubSubTopic.Publish(ctx, out)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user