rafthttp: add necessary locking

This commit is contained in:
Xiang Li 2016-02-16 19:18:05 -08:00
parent 976236b083
commit 56318f5433

View File

@ -289,6 +289,8 @@ func (t *Transport) ActiveSince(id types.ID) time.Time {
}
func (t *Transport) SendSnapshot(m snap.Message) {
t.mu.Lock()
defer t.mu.Unlock()
p := t.peers[types.ID(m.To)]
if p == nil {
m.CloseWithError(errMemberNotFound)