From bd29e81e3a132b041dfc5d6bf1658fa16b445799 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 20 Feb 2018 16:10:53 +0200 Subject: [PATCH] history and gossip length are named constants --- gossipsub.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gossipsub.go b/gossipsub.go index 7efc160..5a02f63 100644 --- a/gossipsub.go +++ b/gossipsub.go @@ -19,6 +19,10 @@ const ( GossipSubD = 6 GossipSubDlo = 4 GossipSubDhi = 12 + + // gossip parameters + GossipSubHistoryLength = 5 + GossipSubHistoryGossip = 3 ) func NewGossipSub(ctx context.Context, h host.Host, opts ...Option) (*PubSub, error) { @@ -28,7 +32,7 @@ func NewGossipSub(ctx context.Context, h host.Host, opts ...Option) (*PubSub, er fanout: make(map[string]map[peer.ID]struct{}), gossip: make(map[peer.ID][]*pb.ControlIHave), control: make(map[peer.ID]*pb.ControlMessage), - mcache: NewMessageCache(3, 5), + mcache: NewMessageCache(GossipSubHistoryGossip, GossipSubHistoryLength), } return NewPubSub(ctx, h, rt, opts...) }