Skip to content

Commit

Permalink
fix(p2p): fix concurrent writes to repo Profile store
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Oct 10, 2018
1 parent da6b5a3 commit 3cf6f5c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions p2p/connected.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ func (n *QriNode) handleConnected(ws *WrappedStream, msg Message) (hangup bool)
}

// forward this message to all connected peers except the sender
pids := peerDifference(n.ConnectedQriPeerIDs(), []peer.ID{pinfo.ID})
if err := n.SendMessage(msg, nil, pids...); err != nil {
log.Debug(err.Error())
return
}
// TODO - this is causing concurrent iteration & write to the repo profile store. Fix
// pids := peerDifference(n.ConnectedQriPeerIDs(), []peer.ID{pinfo.ID})
// if err := n.SendMessage(msg, nil, pids...); err != nil {
// log.Debug(err.Error())
// return
// }

// store that we've seen this message, cleaning up after a while
n.msgState.Store(msg.ID, true)
Expand Down

0 comments on commit 3cf6f5c

Please sign in to comment.