From 682a400d5e036771a9837244710dd55a9cb17df4 Mon Sep 17 00:00:00 2001 From: orcheus Date: Tue, 22 Apr 2014 19:19:40 +0200 Subject: [PATCH] bug fix: no more panic when from<0 When starting doozerd with -l=":8046" then the program crashes because a message is handled here with "from" = -1 (unidentified UDP/TCP source). --- consensus/coordinator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/coordinator.go b/consensus/coordinator.go index 460a9433..12a2f564 100644 --- a/consensus/coordinator.go +++ b/consensus/coordinator.go @@ -55,7 +55,7 @@ func (co *coordinator) update(p *packet, from int) (m *msg, wantTick bool) { co.vv = string(vval) } - if !co.rsvp[from] { + if from>-1 && !co.rsvp[from] { co.rsvp[from] = true co.nrsvp++ }