Skip to content

Commit 1b96f3d

Browse files
committed
validation timeout
1 parent ef18b4d commit 1b96f3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

p2p/subscriber.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"sync"
8+
"time"
89

910
pubsub "github.com/libp2p/go-libp2p-pubsub"
1011
"github.com/libp2p/go-libp2p/core/peer"
@@ -85,7 +86,7 @@ func NewSubscriber[H header.Header[H]](
8586
// be called separately to ensure a validator is mounted on the topic.
8687
func (s *Subscriber[H]) Start(context.Context) (err error) {
8788
log.Debugw("joining topic", "topic ID", s.pubsubTopicID)
88-
err = s.pubsub.RegisterTopicValidator(s.pubsubTopicID, s.verifyMessage)
89+
err = s.pubsub.RegisterTopicValidator(s.pubsubTopicID, s.verifyMessage, pubsub.WithValidatorTimeout(time.Minute))
8990
if err != nil {
9091
return err
9192
}

0 commit comments

Comments
 (0)