neoneo-go/pkg/network
Anna Shaleva 29ef076f4b network: fix race in TestTryInitStateSync
Register peers properly. Fixes the following data race:
```
Read at 0x00c001184ac8 by goroutine 116:
  github.com/nspcc-dev/neo-go/pkg/network.(*localPeer).EnqueueHPPacket()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/helper_test.go:127 +0x1f2
  github.com/nspcc-dev/neo-go/pkg/network.(*localPeer).EnqueuePacket()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/helper_test.go:114 +0xac
  github.com/nspcc-dev/neo-go/pkg/network.(*localPeer).EnqueueMessage()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/helper_test.go:111 +0xc1
  github.com/nspcc-dev/neo-go/pkg/network.(*localPeer).SendPing()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/helper_test.go:159 +0x88
  github.com/nspcc-dev/neo-go/pkg/network.(*Server).runProto()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/server.go:446 +0x409

Previous write at 0x00c001184ac8 by goroutine 102:
  github.com/nspcc-dev/neo-go/pkg/network.newLocalPeer()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/helper_test.go:83 +0x476
  github.com/nspcc-dev/neo-go/pkg/network.TestTryInitStateSync.func3()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:1064 +0x40f
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1123 +0x202

Goroutine 116 (running) created at:
  github.com/nspcc-dev/neo-go/pkg/network.(*Server).run()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/server.go:358 +0x69
  github.com/nspcc-dev/neo-go/pkg/network.(*Server).Start()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/server.go:292 +0x488
  github.com/nspcc-dev/neo-go/pkg/network.startWithChannel.func1()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:91 +0x44

Goroutine 102 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1168 +0x5bb
  github.com/nspcc-dev/neo-go/pkg/network.TestTryInitStateSync()
      /go/src/github.com/nspcc-dev/neo-go/pkg/network/server_test.go:1056 +0xbb
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1123 +0x202
```
2021-09-13 11:45:48 +03:00
..
capability *: enable godot linter and fix all its warnings 2021-05-12 23:17:03 +03:00
extpool *: increase GAS for verification 2021-07-14 10:27:09 +03:00
metrics cli,pkg: use zap.Logger 2020-01-10 11:14:27 +03:00
payload core: implement statesync module 2021-09-07 19:43:27 +03:00
blockqueue.go core: implement statesync module 2021-09-07 19:43:27 +03:00
blockqueue_test.go block: replace Base with Header 2021-03-10 13:38:44 +03:00
compress.go network: handle length mismatch in decompression routine 2020-08-03 22:38:55 +03:00
discovery.go *: enable godot linter and fix all its warnings 2021-05-12 23:17:03 +03:00
discovery_test.go network: optimize waiting in test 2021-07-08 11:14:35 +03:00
helper_test.go *: drop unused structure fields 2021-05-12 19:41:23 +03:00
message.go core: implement statesync module 2021-09-07 19:43:27 +03:00
message_string.go core: implement statesync module 2021-09-07 19:43:27 +03:00
message_test.go core: implement statesync module 2021-09-07 19:43:27 +03:00
notary_feer.go core: introduce mempool notifications 2021-02-02 22:01:32 +03:00
peer.go network: support non-blocking broadcast 2020-12-25 14:36:52 +03:00
prometheus.go monitoring: add prometheus monitoring 2019-10-29 20:51:17 +03:00
server.go network: do not duplicate MPT nodes in GetMPTNodes response 2021-09-08 14:25:54 +03:00
server_config.go network: limit message number from the same sender 2021-05-12 10:52:11 +03:00
server_test.go network: fix race in TestTryInitStateSync 2021-09-13 11:45:48 +03:00
tcp_peer.go core: implement statesync module 2021-09-07 19:43:27 +03:00
tcp_peer_test.go protocol: add capabilities to version payload 2020-05-27 19:01:14 +03:00
tcp_transport.go network: don't log transport errors on exit 2021-07-08 10:40:54 +03:00
transport.go protocol: add capabilities to version payload 2020-05-27 19:01:14 +03:00