Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2809 from tbenz9/consensus-optimization
Browse files Browse the repository at this point in the history
only update subscribers if there are any
  • Loading branch information
lukechampine committed Mar 2, 2018
2 parents 17432ba + a9644e3 commit 978bed1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/consensus/subscribe.go
Expand Up @@ -99,6 +99,9 @@ func (cs *ConsensusSet) computeConsensusChange(tx *bolt.Tx, ce changeEntry) (mod
// consensus set. updateSubscribers does not alter the changelog, the changelog
// must be updated beforehand.
func (cs *ConsensusSet) updateSubscribers(ce changeEntry) {
if len(cs.subscribers) == 0 {
return
}
// Get the consensus change and send it to all subscribers.
var cc modules.ConsensusChange
err := cs.db.View(func(tx *bolt.Tx) error {
Expand Down

0 comments on commit 978bed1

Please sign in to comment.