Started gossiping thread

This commit is contained in:
StephenButtolph 2020-05-04 02:44:56 -04:00
parent 4a989dc621
commit 13fbe14d44
3 changed files with 5 additions and 2 deletions

View File

@ -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())
}

View File

@ -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())
}

View File

@ -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