Sending packet copies to the Watcher

Sending packet copies to the Watcher

by Kirill Nikitin -
Number of replies: 0

Dear all,

In the packets.go file of the updated skeleton, you will find a new Copy() method. You should use it to create a deep copy of each gossip packet before sending it to the Watcher. This should help with avoiding race conditions. We have updated also the comment with the example of notifying the Watcher in gossiper.go: the difference is simply to send packet.Copy(), instead of packet.

The CS-438 Team