payload: {"action":"created","comment":{"url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments/324643100","pull_request_review_id":288587184,"id":324643100,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyNDY0MzEwMA==","diff_hunk":"@@ -312,29 +315,37 @@ func (s *Server) handleMessage(peer Peer, msg *Message) error {\n \t\treturn errInvalidNetwork\n \t}\n \n-\tswitch msg.CommandType() {\n-\tcase CMDAddr:\n-\t\taddrs := msg.Payload.(*payload.AddressList)\n-\t\treturn s.handleAddrCmd(peer, addrs)\n-\tcase CMDVersion:\n-\t\tversion := msg.Payload.(*payload.Version)\n-\t\treturn s.handleVersionCmd(peer, version)\n-\tcase CMDHeaders:\n-\t\theaders := msg.Payload.(*payload.Headers)\n-\t\tgo s.handleHeadersCmd(peer, headers)\n-\tcase CMDInv:\n-\t\tinventory := msg.Payload.(*payload.Inventory)\n-\t\treturn s.handleInvCmd(peer, inventory)\n-\tcase CMDBlock:\n-\t\tblock := msg.Payload.(*core.Block)\n-\t\treturn s.handleBlockCmd(peer, block)\n-\tcase CMDVerack:\n-\t\t// Make sure this peer has send his version before we start the\n-\t\t// protocol with that peer.\n-\t\tif peer.Version() == nil {\n-\t\t\treturn errInvalidHandshake\n+\tif peer.Handshaked() {\n+\t\tswitch msg.CommandType() {\n+\t\tcase CMDAddr:\n+\t\t\taddrs := msg.Payload.(*payload.AddressList)\n+\t\t\treturn s.handleAddrCmd(peer, addrs)\n+\t\tcase CMDHeaders:\n+\t\t\theaders := msg.Payload.(*payload.Headers)\n+\t\t\tgo s.handleHeadersCmd(peer, headers)","path":"pkg/network/server.go","position":266,"original_position":61,"commit_id":"20bdd2b818852c31e1cd0880abd9df702716e0e5","original_commit_id":"6868615ee5457138af350cd57ca46cde4d2cc252","user":{"login":"volekerb","id":11260070,"node_id":"MDQ6VXNlcjExMjYwMDcw","avatar_url":"https://avatars0.githubusercontent.com/u/11260070?v=4","gravatar_id":"","url":"https://api.github.com/users/volekerb","html_url":"https://github.com/volekerb","followers_url":"https://api.github.com/users/volekerb/followers","following_url":"https://api.github.com/users/volekerb/following{/other_user}","gists_url":"https://api.github.com/users/volekerb/gists{/gist_id}","starred_url":"https://api.github.com/users/volekerb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volekerb/subscriptions","organizations_url":"https://api.github.com/users/volekerb/orgs","repos_url":"https://api.github.com/users/volekerb/repos","events_url":"https://api.github.com/users/volekerb/events{/privacy}","received_events_url":"https://api.github.com/users/volekerb/received_events","type":"User","site_admin":false},"body":"curios: \r\nwhy do u handle headers in separate routine but handle blocks not?","created_at":"2019-09-16T12:24:05Z","updated_at":"2019-09-16T12:24:06Z","html_url":"https://github.com/nspcc-dev/neo-go/pull/396#discussion_r324643100","pull_request_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments/324643100"},"html":{"href":"https://github.com/nspcc-dev/neo-go/pull/396#discussion_r324643100"},"pull_request":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396"}}},"pull_request":{"url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396","id":317376472,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE3Mzc2NDcy","html_url":"https://github.com/nspcc-dev/neo-go/pull/396","diff_url":"https://github.com/nspcc-dev/neo-go/pull/396.diff","patch_url":"https://github.com/nspcc-dev/neo-go/pull/396.patch","issue_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/396","number":396,"state":"open","locked":false,"title":"Network reconnections and fixes","user":{"login":"roman-khimov","id":22092804,"node_id":"MDQ6VXNlcjIyMDkyODA0","avatar_url":"https://avatars3.githubusercontent.com/u/22092804?v=4","gravatar_id":"","url":"https://api.github.com/users/roman-khimov","html_url":"https://github.com/roman-khimov","followers_url":"https://api.github.com/users/roman-khimov/followers","following_url":"https://api.github.com/users/roman-khimov/following{/other_user}","gists_url":"https://api.github.com/users/roman-khimov/gists{/gist_id}","starred_url":"https://api.github.com/users/roman-khimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman-khimov/subscriptions","organizations_url":"https://api.github.com/users/roman-khimov/orgs","repos_url":"https://api.github.com/users/roman-khimov/repos","events_url":"https://api.github.com/users/roman-khimov/events{/privacy}","received_events_url":"https://api.github.com/users/roman-khimov/received_events","type":"User","site_admin":false},"body":"This one fixes #390 and some connected problems. After this patchset the node reconnects to some other nodes if anything goes wrong and it better senses when something goes wrong. It also fixes some block handling problems based on the testnet connection experience.","created_at":"2019-09-13T15:27:39Z","updated_at":"2019-09-16T12:24:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e21ab57ee09ebe04fdaf24c35d42b747f35354d7","assignee":{"login":"roman-khimov","id":22092804,"node_id":"MDQ6VXNlcjIyMDkyODA0","avatar_url":"https://avatars3.githubusercontent.com/u/22092804?v=4","gravatar_id":"","url":"https://api.github.com/users/roman-khimov","html_url":"https://github.com/roman-khimov","followers_url":"https://api.github.com/users/roman-khimov/followers","following_url":"https://api.github.com/users/roman-khimov/following{/other_user}","gists_url":"https://api.github.com/users/roman-khimov/gists{/gist_id}","starred_url":"https://api.github.com/users/roman-khimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman-khimov/subscriptions","organizations_url":"https://api.github.com/users/roman-khimov/orgs","repos_url":"https://api.github.com/users/roman-khimov/repos","events_url":"https://api.github.com/users/roman-khimov/events{/privacy}","received_events_url":"https://api.github.com/users/roman-khimov/received_events","type":"User","site_admin":false},"assignees":[{"login":"roman-khimov","id":22092804,"node_id":"MDQ6VXNlcjIyMDkyODA0","avatar_url":"https://avatars3.githubusercontent.com/u/22092804?v=4","gravatar_id":"","url":"https://api.github.com/users/roman-khimov","html_url":"https://github.com/roman-khimov","followers_url":"https://api.github.com/users/roman-khimov/followers","following_url":"https://api.github.com/users/roman-khimov/following{/other_user}","gists_url":"https://api.github.com/users/roman-khimov/gists{/gist_id}","starred_url":"https://api.github.com/users/roman-khimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman-khimov/subscriptions","organizations_url":"https://api.github.com/users/roman-khimov/orgs","repos_url":"https://api.github.com/users/roman-khimov/repos","events_url":"https://api.github.com/users/roman-khimov/events{/privacy}","received_events_url":"https://api.github.com/users/roman-khimov/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396/commits","review_comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396/comments","review_comment_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/396/comments","statuses_url":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/20bdd2b818852c31e1cd0880abd9df702716e0e5","head":{"label":"nspcc-dev:network-reconnections-and-fixes","ref":"network-reconnections-and-fixes","sha":"20bdd2b818852c31e1cd0880abd9df702716e0e5","user":{"login":"nspcc-dev","id":45291212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjkxMjEy","avatar_url":"https://avatars1.githubusercontent.com/u/45291212?v=4","gravatar_id":"","url":"https://api.github.com/users/nspcc-dev","html_url":"https://github.com/nspcc-dev","followers_url":"https://api.github.com/users/nspcc-dev/followers","following_url":"https://api.github.com/users/nspcc-dev/following{/other_user}","gists_url":"https://api.github.com/users/nspcc-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/nspcc-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspcc-dev/subscriptions","organizations_url":"https://api.github.com/users/nspcc-dev/orgs","repos_url":"https://api.github.com/users/nspcc-dev/repos","events_url":"https://api.github.com/users/nspcc-dev/events{/privacy}","received_events_url":"https://api.github.com/users/nspcc-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":119681680,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk2ODE2ODA=","name":"neo-go","full_name":"nspcc-dev/neo-go","private":false,"owner":{"login":"nspcc-dev","id":45291212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjkxMjEy","avatar_url":"https://avatars1.githubusercontent.com/u/45291212?v=4","gravatar_id":"","url":"https://api.github.com/users/nspcc-dev","html_url":"https://github.com/nspcc-dev","followers_url":"https://api.github.com/users/nspcc-dev/followers","following_url":"https://api.github.com/users/nspcc-dev/following{/other_user}","gists_url":"https://api.github.com/users/nspcc-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/nspcc-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspcc-dev/subscriptions","organizations_url":"https://api.github.com/users/nspcc-dev/orgs","repos_url":"https://api.github.com/users/nspcc-dev/repos","events_url":"https://api.github.com/users/nspcc-dev/events{/privacy}","received_events_url":"https://api.github.com/users/nspcc-dev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nspcc-dev/neo-go","description":"Go Node and SDK for the NEO blockchain","fork":false,"url":"https://api.github.com/repos/nspcc-dev/neo-go","forks_url":"https://api.github.com/repos/nspcc-dev/neo-go/forks","keys_url":"https://api.github.com/repos/nspcc-dev/neo-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nspcc-dev/neo-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nspcc-dev/neo-go/teams","hooks_url":"https://api.github.com/repos/nspcc-dev/neo-go/hooks","issue_events_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/events{/number}","events_url":"https://api.github.com/repos/nspcc-dev/neo-go/events","assignees_url":"https://api.github.com/repos/nspcc-dev/neo-go/assignees{/user}","branches_url":"https://api.github.com/repos/nspcc-dev/neo-go/branches{/branch}","tags_url":"https://api.github.com/repos/nspcc-dev/neo-go/tags","blobs_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/{sha}","languages_url":"https://api.github.com/repos/nspcc-dev/neo-go/languages","stargazers_url":"https://api.github.com/repos/nspcc-dev/neo-go/stargazers","contributors_url":"https://api.github.com/repos/nspcc-dev/neo-go/contributors","subscribers_url":"https://api.github.com/repos/nspcc-dev/neo-go/subscribers","subscription_url":"https://api.github.com/repos/nspcc-dev/neo-go/subscription","commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/nspcc-dev/neo-go/contents/{+path}","compare_url":"https://api.github.com/repos/nspcc-dev/neo-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nspcc-dev/neo-go/merges","archive_url":"https://api.github.com/repos/nspcc-dev/neo-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nspcc-dev/neo-go/downloads","issues_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues{/number}","pulls_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls{/number}","milestones_url":"https://api.github.com/repos/nspcc-dev/neo-go/milestones{/number}","notifications_url":"https://api.github.com/repos/nspcc-dev/neo-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nspcc-dev/neo-go/labels{/name}","releases_url":"https://api.github.com/repos/nspcc-dev/neo-go/releases{/id}","deployments_url":"https://api.github.com/repos/nspcc-dev/neo-go/deployments","created_at":"2018-01-31T12:02:17Z","updated_at":"2019-09-14T10:00:55Z","pushed_at":"2019-09-16T07:51:07Z","git_url":"git://github.com/nspcc-dev/neo-go.git","ssh_url":"git@github.com:nspcc-dev/neo-go.git","clone_url":"https://github.com/nspcc-dev/neo-go.git","svn_url":"https://github.com/nspcc-dev/neo-go","homepage":"","size":8946,"stargazers_count":36,"watchers_count":36,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":48,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":28,"open_issues":48,"watchers":36,"default_branch":"master"}},"base":{"label":"nspcc-dev:master","ref":"master","sha":"b21a220712ddf012fb6386862f7fee985c851727","user":{"login":"nspcc-dev","id":45291212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjkxMjEy","avatar_url":"https://avatars1.githubusercontent.com/u/45291212?v=4","gravatar_id":"","url":"https://api.github.com/users/nspcc-dev","html_url":"https://github.com/nspcc-dev","followers_url":"https://api.github.com/users/nspcc-dev/followers","following_url":"https://api.github.com/users/nspcc-dev/following{/other_user}","gists_url":"https://api.github.com/users/nspcc-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/nspcc-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspcc-dev/subscriptions","organizations_url":"https://api.github.com/users/nspcc-dev/orgs","repos_url":"https://api.github.com/users/nspcc-dev/repos","events_url":"https://api.github.com/users/nspcc-dev/events{/privacy}","received_events_url":"https://api.github.com/users/nspcc-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":119681680,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk2ODE2ODA=","name":"neo-go","full_name":"nspcc-dev/neo-go","private":false,"owner":{"login":"nspcc-dev","id":45291212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjkxMjEy","avatar_url":"https://avatars1.githubusercontent.com/u/45291212?v=4","gravatar_id":"","url":"https://api.github.com/users/nspcc-dev","html_url":"https://github.com/nspcc-dev","followers_url":"https://api.github.com/users/nspcc-dev/followers","following_url":"https://api.github.com/users/nspcc-dev/following{/other_user}","gists_url":"https://api.github.com/users/nspcc-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/nspcc-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspcc-dev/subscriptions","organizations_url":"https://api.github.com/users/nspcc-dev/orgs","repos_url":"https://api.github.com/users/nspcc-dev/repos","events_url":"https://api.github.com/users/nspcc-dev/events{/privacy}","received_events_url":"https://api.github.com/users/nspcc-dev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nspcc-dev/neo-go","description":"Go Node and SDK for the NEO blockchain","fork":false,"url":"https://api.github.com/repos/nspcc-dev/neo-go","forks_url":"https://api.github.com/repos/nspcc-dev/neo-go/forks","keys_url":"https://api.github.com/repos/nspcc-dev/neo-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nspcc-dev/neo-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nspcc-dev/neo-go/teams","hooks_url":"https://api.github.com/repos/nspcc-dev/neo-go/hooks","issue_events_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/events{/number}","events_url":"https://api.github.com/repos/nspcc-dev/neo-go/events","assignees_url":"https://api.github.com/repos/nspcc-dev/neo-go/assignees{/user}","branches_url":"https://api.github.com/repos/nspcc-dev/neo-go/branches{/branch}","tags_url":"https://api.github.com/repos/nspcc-dev/neo-go/tags","blobs_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/{sha}","languages_url":"https://api.github.com/repos/nspcc-dev/neo-go/languages","stargazers_url":"https://api.github.com/repos/nspcc-dev/neo-go/stargazers","contributors_url":"https://api.github.com/repos/nspcc-dev/neo-go/contributors","subscribers_url":"https://api.github.com/repos/nspcc-dev/neo-go/subscribers","subscription_url":"https://api.github.com/repos/nspcc-dev/neo-go/subscription","commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/nspcc-dev/neo-go/contents/{+path}","compare_url":"https://api.github.com/repos/nspcc-dev/neo-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nspcc-dev/neo-go/merges","archive_url":"https://api.github.com/repos/nspcc-dev/neo-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nspcc-dev/neo-go/downloads","issues_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues{/number}","pulls_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls{/number}","milestones_url":"https://api.github.com/repos/nspcc-dev/neo-go/milestones{/number}","notifications_url":"https://api.github.com/repos/nspcc-dev/neo-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nspcc-dev/neo-go/labels{/name}","releases_url":"https://api.github.com/repos/nspcc-dev/neo-go/releases{/id}","deployments_url":"https://api.github.com/repos/nspcc-dev/neo-go/deployments","created_at":"2018-01-31T12:02:17Z","updated_at":"2019-09-14T10:00:55Z","pushed_at":"2019-09-16T07:51:07Z","git_url":"git://github.com/nspcc-dev/neo-go.git","ssh_url":"git@github.com:nspcc-dev/neo-go.git","clone_url":"https://github.com/nspcc-dev/neo-go.git","svn_url":"https://github.com/nspcc-dev/neo-go","homepage":"","size":8946,"stargazers_count":36,"watchers_count":36,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":48,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":28,"open_issues":48,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396"},"html":{"href":"https://github.com/nspcc-dev/neo-go/pull/396"},"issue":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/issues/396"},"comments":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/issues/396/comments"},"review_comments":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396/comments"},"review_comment":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/396/commits"},"statuses":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/20bdd2b818852c31e1cd0880abd9df702716e0e5"}},"author_association":"COLLABORATOR"}}
other: {"actor":{"display_login":"volekerb"}}