From dc566d094285618426be0fe81d885d90df54f17d Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 23 Apr 2018 18:02:19 +0200 Subject: [PATCH] [client.keyset] included maxDepth() in random depth generation --- src/git.xdrm.io/schastsp/client/keyset/keyset.internal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git.xdrm.io/schastsp/client/keyset/keyset.internal.go b/src/git.xdrm.io/schastsp/client/keyset/keyset.internal.go index 1d3819d..9991bb1 100644 --- a/src/git.xdrm.io/schastsp/client/keyset/keyset.internal.go +++ b/src/git.xdrm.io/schastsp/client/keyset/keyset.internal.go @@ -30,7 +30,7 @@ func (s *T) generate() { var randMin, randMax = s.ctx.MinDepth() + (s.ctx.MaxDepth()-s.ctx.MinDepth()) / 2, s.ctx.MaxDepth() /* (2) Select "random" depth */ - s.depth = randMin + uint16(rand.Intn(int(randMax-randMin))) + s.depth = randMin + uint16(rand.Intn(int(randMax+1-randMin))) /* (3) Reset comsumption level */ s.mcode = 0