whisper: fix a small data race duirng peer connection
This commit is contained in:
@ -23,18 +23,14 @@ type peer struct {
|
||||
|
||||
// newPeer creates and initializes a new whisper peer connection, returning either
|
||||
// the newly constructed link or a failure reason.
|
||||
func newPeer(host *Whisper, remote *p2p.Peer, rw p2p.MsgReadWriter) (*peer, error) {
|
||||
p := &peer{
|
||||
func newPeer(host *Whisper, remote *p2p.Peer, rw p2p.MsgReadWriter) *peer {
|
||||
return &peer{
|
||||
host: host,
|
||||
peer: remote,
|
||||
ws: rw,
|
||||
known: set.New(),
|
||||
quit: make(chan struct{}),
|
||||
}
|
||||
if err := p.handshake(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// start initiates the peer updater, periodically broadcasting the whisper packets
|
||||
|
Reference in New Issue
Block a user