From 13fbe14d44ca71917be4d141860fb920f6018c39 Mon Sep 17 00:00:00 2001 From: StephenButtolph Date: Mon, 4 May 2020 02:44:56 -0400 Subject: [PATCH] Started gossiping thread --- snow/engine/avalanche/transitive.go | 2 +- snow/engine/snowman/transitive.go | 2 +- snow/networking/router/subnet_router.go | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/snow/engine/avalanche/transitive.go b/snow/engine/avalanche/transitive.go index 4b33007..56f9a21 100644 --- a/snow/engine/avalanche/transitive.go +++ b/snow/engine/avalanche/transitive.go @@ -78,7 +78,7 @@ func (t *Transitive) Gossip() { return } - t.Config.Context.Log.Info("Gossiping %s as accepted to the network", vtxID) + t.Config.Context.Log.Debug("Gossiping %s as accepted to the network", vtxID) t.Config.Sender.Gossip(vtxID, vtx.Bytes()) } diff --git a/snow/engine/snowman/transitive.go b/snow/engine/snowman/transitive.go index f4778ac..4bea6c5 100644 --- a/snow/engine/snowman/transitive.go +++ b/snow/engine/snowman/transitive.go @@ -74,7 +74,7 @@ func (t *Transitive) Gossip() { return } - t.Config.Context.Log.Info("Gossiping %s as accepted to the network", blkID) + t.Config.Context.Log.Debug("Gossiping %s as accepted to the network", blkID) t.Config.Sender.Gossip(blkID, blk.Bytes()) } diff --git a/snow/networking/router/subnet_router.go b/snow/networking/router/subnet_router.go index 24b6efb..f1ac4e7 100644 --- a/snow/networking/router/subnet_router.go +++ b/snow/networking/router/subnet_router.go @@ -34,6 +34,8 @@ func (sr *ChainRouter) Initialize(log logging.Logger, timeouts *timeout.Manager, sr.chains = make(map[[32]byte]*handler.Handler) sr.timeouts = timeouts sr.gossiper = timer.NewRepeater(sr.Gossip, gossipFrequency) + + go log.RecoverAndPanic(sr.gossiper.Dispatch) } // AddChain registers the specified chain so that incoming @@ -259,6 +261,7 @@ func (sr *ChainRouter) shutdown() { for _, chain := range sr.chains { chain.Shutdown() } + sr.gossiper.Stop() } // Gossip accepted containers