From 9d250aef37077a4ae17edcbf04048a182989fe16 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 26 Aug 2018 13:40:11 +0300 Subject: [PATCH] option to enable message signing --- pubsub.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pubsub.go b/pubsub.go index fd89dc9..c1e5cc4 100644 --- a/pubsub.go +++ b/pubsub.go @@ -190,6 +190,13 @@ func WithValidateThrottle(n int) Option { } } +func WithMessageSigning() Option { + return func(p *PubSub) error { + p.signKey = p.host.Peerstore().PrivKey(p.host.ID()) + return nil + } +} + // processLoop handles all inputs arriving on the channels func (p *PubSub) processLoop(ctx context.Context) { defer func() {