Browse Source

remove unused tracking because it leads to memory leaks in tests

see https://blog.cosmos.network/debugging-the-memory-leak-in-tendermint-210186711420
pull/1350/head
Anton Kaliaev 7 years ago
parent
commit
fc9ffee2e3
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 2 additions and 12 deletions
  1. +2
    -12
      p2p/switch_test.go

+ 2
- 12
p2p/switch_test.go View File

@ -39,8 +39,6 @@ type TestReactor struct {
mtx sync.Mutex
channels []*conn.ChannelDescriptor
peersAdded []Peer
peersRemoved []Peer
logMessages bool
msgsCounter int
msgsReceived map[byte][]PeerMessage
@ -61,17 +59,9 @@ func (tr *TestReactor) GetChannels() []*conn.ChannelDescriptor {
return tr.channels
}
func (tr *TestReactor) AddPeer(peer Peer) {
tr.mtx.Lock()
defer tr.mtx.Unlock()
tr.peersAdded = append(tr.peersAdded, peer)
}
func (tr *TestReactor) AddPeer(peer Peer) {}
func (tr *TestReactor) RemovePeer(peer Peer, reason interface{}) {
tr.mtx.Lock()
defer tr.mtx.Unlock()
tr.peersRemoved = append(tr.peersRemoved, peer)
}
func (tr *TestReactor) RemovePeer(peer Peer, reason interface{}) {}
func (tr *TestReactor) Receive(chID byte, peer Peer, msgBytes []byte) {
if tr.logMessages {


Loading…
Cancel
Save