From d7bfbc71824c577d651e3d44e647bb3ac49568ef Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Wed, 18 Sep 2019 01:22:34 +0100 Subject: [PATCH] use before set, see #174 (thanks to @Glandos) --- cmd/magneticod/dht/mainline/protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/magneticod/dht/mainline/protocol.go b/cmd/magneticod/dht/mainline/protocol.go index 9a88ac3..92c7661 100644 --- a/cmd/magneticod/dht/mainline/protocol.go +++ b/cmd/magneticod/dht/mainline/protocol.go @@ -36,8 +36,8 @@ type ProtocolEventHandlers struct { func NewProtocol(laddr string, eventHandlers ProtocolEventHandlers) (p *Protocol) { p = new(Protocol) - p.transport = NewTransport(laddr, p.onMessage, p.eventHandlers.OnCongestion) p.eventHandlers = eventHandlers + p.transport = NewTransport(laddr, p.onMessage, p.eventHandlers.OnCongestion) p.currentTokenSecret, p.previousTokenSecret = make([]byte, 20), make([]byte, 20) _, err := rand.Read(p.currentTokenSecret)