We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68ca620 commit 5c994c6Copy full SHA for 5c994c6
gossip/gossip/channel/channel.go
@@ -1030,6 +1030,7 @@ type stateInfoCache struct {
1030
*util.MembershipStore
1031
msgstore.MessageStore
1032
stopChan chan struct{}
1033
+ stopOnce sync.Once
1034
}
1035
1036
func (cache *stateInfoCache) validate(orgs []api.OrgIdentityType) {
@@ -1068,7 +1069,9 @@ func (cache *stateInfoCache) delete(msg *protoext.SignedGossipMessage) {
1068
1069
1070
1071
func (cache *stateInfoCache) Stop() {
- cache.stopChan <- struct{}{}
1072
+ cache.stopOnce.Do(func() {
1073
+ close(cache.stopChan)
1074
+ })
1075
1076
1077
// GenerateMAC returns a byte slice that is derived from the peer's PKI-ID
0 commit comments