{"action":"created","comment":{"url":"https://api.github.com/repos/Bytom/bytom/pulls/comments/178424821","pull_request_review_id":108485929,"id":178424821,"diff_hunk":"@@ -0,0 +1,303 @@\n+package netsync\n+\n+import (\n+\t\"strings\"\n+\t\"sync\"\n+\t\"time\"\n+\n+\tlog \"github.com/sirupsen/logrus\"\n+\n+\t\"github.com/bytom/errors\"\n+\t\"github.com/bytom/p2p\"\n+\t\"github.com/bytom/protocol\"\n+\t\"github.com/bytom/protocol/bc\"\n+\t\"github.com/bytom/protocol/bc/types\"\n+)\n+\n+const (\n+\tmaxKnownTxs    = 32768 // Maximum transactions hashes to keep in the known list (prevent DOS)\n+\tmaxKnownBlocks = 1024  // Maximum block hashes to keep in the known list (prevent DOS)\n+\n+\tsyncTimeout        = 30 * time.Second\n+\trequestRetryTicker = 15 * time.Second\n+\n+\tmaxBlocksPending = 1024\n+\tmaxtxsPending    = 32768\n+)\n+\n+var (\n+\terrGetBlockTimeout = errors.New(\"Get block Timeout\")\n+\terrPeerDropped     = errors.New(\"Peer dropped\")\n+\terrCommAbnorm      = errors.New(\"Peer communication abnormality\")\n+\terrScamPeer        = errors.New(\"Scam peer\")\n+)\n+\n+type BlockRequestMessage struct {\n+\tHeight  uint64\n+\tRawHash [32]byte\n+}\n+\n+type pendingResponse struct {\n+\tblock *types.Block\n+\tsrc   *p2p.Peer","path":"netsync/block_keeper.go","position":42,"original_position":42,"commit_id":"f265cfc10b959bdee7bfc7719c50011996a9e189","original_commit_id":"f265cfc10b959bdee7bfc7719c50011996a9e189","user":{"login":"Paladz","id":6713162,"avatar_url":"https://avatars0.githubusercontent.com/u/6713162?v=4","gravatar_id":"","url":"https://api.github.com/users/Paladz","html_url":"https://github.com/Paladz","followers_url":"https://api.github.com/users/Paladz/followers","following_url":"https://api.github.com/users/Paladz/following{/other_user}","gists_url":"https://api.github.com/users/Paladz/gists{/gist_id}","starred_url":"https://api.github.com/users/Paladz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paladz/subscriptions","organizations_url":"https://api.github.com/users/Paladz/orgs","repos_url":"https://api.github.com/users/Paladz/repos","events_url":"https://api.github.com/users/Paladz/events{/privacy}","received_events_url":"https://api.github.com/users/Paladz/received_events","type":"User","site_admin":false},"body":"留peerID应该就可以了","created_at":"2018-03-31T06:37:46Z","updated_at":"2018-03-31T06:37:46Z","html_url":"https://github.com/Bytom/bytom/pull/501#discussion_r178424821","pull_request_url":"https://api.github.com/repos/Bytom/bytom/pulls/501","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Bytom/bytom/pulls/comments/178424821"},"html":{"href":"https://github.com/Bytom/bytom/pull/501#discussion_r178424821"},"pull_request":{"href":"https://api.github.com/repos/Bytom/bytom/pulls/501"}}},"pull_request":{"url":"https://api.github.com/repos/Bytom/bytom/pulls/501","id":178483455,"html_url":"https://github.com/Bytom/bytom/pull/501","diff_url":"https://github.com/Bytom/bytom/pull/501.diff","patch_url":"https://github.com/Bytom/bytom/pull/501.patch","issue_url":"https://api.github.com/repos/Bytom/bytom/issues/501","number":501,"state":"open","locked":false,"title":"Optimize p2p transfer business layer logic","user":{"login":"yahtoo","id":20079910,"avatar_url":"https://avatars3.githubusercontent.com/u/20079910?v=4","gravatar_id":"","url":"https://api.github.com/users/yahtoo","html_url":"https://github.com/yahtoo","followers_url":"https://api.github.com/users/yahtoo/followers","following_url":"https://api.github.com/users/yahtoo/following{/other_user}","gists_url":"https://api.github.com/users/yahtoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahtoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahtoo/subscriptions","organizations_url":"https://api.github.com/users/yahtoo/orgs","repos_url":"https://api.github.com/users/yahtoo/repos","events_url":"https://api.github.com/users/yahtoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahtoo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-30T02:43:03Z","updated_at":"2018-03-31T06:37:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Bytom/bytom/pulls/501/commits","review_comments_url":"https://api.github.com/repos/Bytom/bytom/pulls/501/comments","review_comment_url":"https://api.github.com/repos/Bytom/bytom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bytom/bytom/issues/501/comments","statuses_url":"https://api.github.com/repos/Bytom/bytom/statuses/f265cfc10b959bdee7bfc7719c50011996a9e189","head":{"label":"Bytom:p2p_optimize","ref":"p2p_optimize","sha":"f265cfc10b959bdee7bfc7719c50011996a9e189","user":{"login":"Bytom","id":28505705,"avatar_url":"https://avatars0.githubusercontent.com/u/28505705?v=4","gravatar_id":"","url":"https://api.github.com/users/Bytom","html_url":"https://github.com/Bytom","followers_url":"https://api.github.com/users/Bytom/followers","following_url":"https://api.github.com/users/Bytom/following{/other_user}","gists_url":"https://api.github.com/users/Bytom/gists{/gist_id}","starred_url":"https://api.github.com/users/Bytom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bytom/subscriptions","organizations_url":"https://api.github.com/users/Bytom/orgs","repos_url":"https://api.github.com/users/Bytom/repos","events_url":"https://api.github.com/users/Bytom/events{/privacy}","received_events_url":"https://api.github.com/users/Bytom/received_events","type":"Organization","site_admin":false},"repo":{"id":97181001,"name":"bytom","full_name":"Bytom/bytom","owner":{"login":"Bytom","id":28505705,"avatar_url":"https://avatars0.githubusercontent.com/u/28505705?v=4","gravatar_id":"","url":"https://api.github.com/users/Bytom","html_url":"https://github.com/Bytom","followers_url":"https://api.github.com/users/Bytom/followers","following_url":"https://api.github.com/users/Bytom/following{/other_user}","gists_url":"https://api.github.com/users/Bytom/gists{/gist_id}","starred_url":"https://api.github.com/users/Bytom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bytom/subscriptions","organizations_url":"https://api.github.com/users/Bytom/orgs","repos_url":"https://api.github.com/users/Bytom/repos","events_url":"https://api.github.com/users/Bytom/events{/privacy}","received_events_url":"https://api.github.com/users/Bytom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bytom/bytom","description":"Official Go implementation of the Bytom protocol ","fork":false,"url":"https://api.github.com/repos/Bytom/bytom","forks_url":"https://api.github.com/repos/Bytom/bytom/forks","keys_url":"https://api.github.com/repos/Bytom/bytom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bytom/bytom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bytom/bytom/teams","hooks_url":"https://api.github.com/repos/Bytom/bytom/hooks","issue_events_url":"https://api.github.com/repos/Bytom/bytom/issues/events{/number}","events_url":"https://api.github.com/repos/Bytom/bytom/events","assignees_url":"https://api.github.com/repos/Bytom/bytom/assignees{/user}","branches_url":"https://api.github.com/repos/Bytom/bytom/branches{/branch}","tags_url":"https://api.github.com/repos/Bytom/bytom/tags","blobs_url":"https://api.github.com/repos/Bytom/bytom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bytom/bytom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bytom/bytom/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bytom/bytom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bytom/bytom/statuses/{sha}","languages_url":"https://api.github.com/repos/Bytom/bytom/languages","stargazers_url":"https://api.github.com/repos/Bytom/bytom/stargazers","contributors_url":"https://api.github.com/repos/Bytom/bytom/contributors","subscribers_url":"https://api.github.com/repos/Bytom/bytom/subscribers","subscription_url":"https://api.github.com/repos/Bytom/bytom/subscription","commits_url":"https://api.github.com/repos/Bytom/bytom/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bytom/bytom/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bytom/bytom/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bytom/bytom/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bytom/bytom/contents/{+path}","compare_url":"https://api.github.com/repos/Bytom/bytom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bytom/bytom/merges","archive_url":"https://api.github.com/repos/Bytom/bytom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bytom/bytom/downloads","issues_url":"https://api.github.com/repos/Bytom/bytom/issues{/number}","pulls_url":"https://api.github.com/repos/Bytom/bytom/pulls{/number}","milestones_url":"https://api.github.com/repos/Bytom/bytom/milestones{/number}","notifications_url":"https://api.github.com/repos/Bytom/bytom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bytom/bytom/labels{/name}","releases_url":"https://api.github.com/repos/Bytom/bytom/releases{/id}","deployments_url":"https://api.github.com/repos/Bytom/bytom/deployments","created_at":"2017-07-14T01:47:33Z","updated_at":"2018-03-30T17:12:40Z","pushed_at":"2018-03-31T06:05:14Z","git_url":"git://github.com/Bytom/bytom.git","ssh_url":"git@github.com:Bytom/bytom.git","clone_url":"https://github.com/Bytom/bytom.git","svn_url":"https://github.com/Bytom/bytom","homepage":"https://bytom.io/","size":47413,"stargazers_count":491,"watchers_count":491,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":149,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":149,"open_issues":24,"watchers":491,"default_branch":"master"}},"base":{"label":"Bytom:dev","ref":"dev","sha":"5728cb7377031a1dafc80a8b9be1d25c2ee9ad01","user":{"login":"Bytom","id":28505705,"avatar_url":"https://avatars0.githubusercontent.com/u/28505705?v=4","gravatar_id":"","url":"https://api.github.com/users/Bytom","html_url":"https://github.com/Bytom","followers_url":"https://api.github.com/users/Bytom/followers","following_url":"https://api.github.com/users/Bytom/following{/other_user}","gists_url":"https://api.github.com/users/Bytom/gists{/gist_id}","starred_url":"https://api.github.com/users/Bytom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bytom/subscriptions","organizations_url":"https://api.github.com/users/Bytom/orgs","repos_url":"https://api.github.com/users/Bytom/repos","events_url":"https://api.github.com/users/Bytom/events{/privacy}","received_events_url":"https://api.github.com/users/Bytom/received_events","type":"Organization","site_admin":false},"repo":{"id":97181001,"name":"bytom","full_name":"Bytom/bytom","owner":{"login":"Bytom","id":28505705,"avatar_url":"https://avatars0.githubusercontent.com/u/28505705?v=4","gravatar_id":"","url":"https://api.github.com/users/Bytom","html_url":"https://github.com/Bytom","followers_url":"https://api.github.com/users/Bytom/followers","following_url":"https://api.github.com/users/Bytom/following{/other_user}","gists_url":"https://api.github.com/users/Bytom/gists{/gist_id}","starred_url":"https://api.github.com/users/Bytom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bytom/subscriptions","organizations_url":"https://api.github.com/users/Bytom/orgs","repos_url":"https://api.github.com/users/Bytom/repos","events_url":"https://api.github.com/users/Bytom/events{/privacy}","received_events_url":"https://api.github.com/users/Bytom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bytom/bytom","description":"Official Go implementation of the Bytom protocol ","fork":false,"url":"https://api.github.com/repos/Bytom/bytom","forks_url":"https://api.github.com/repos/Bytom/bytom/forks","keys_url":"https://api.github.com/repos/Bytom/bytom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bytom/bytom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bytom/bytom/teams","hooks_url":"https://api.github.com/repos/Bytom/bytom/hooks","issue_events_url":"https://api.github.com/repos/Bytom/bytom/issues/events{/number}","events_url":"https://api.github.com/repos/Bytom/bytom/events","assignees_url":"https://api.github.com/repos/Bytom/bytom/assignees{/user}","branches_url":"https://api.github.com/repos/Bytom/bytom/branches{/branch}","tags_url":"https://api.github.com/repos/Bytom/bytom/tags","blobs_url":"https://api.github.com/repos/Bytom/bytom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bytom/bytom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bytom/bytom/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bytom/bytom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bytom/bytom/statuses/{sha}","languages_url":"https://api.github.com/repos/Bytom/bytom/languages","stargazers_url":"https://api.github.com/repos/Bytom/bytom/stargazers","contributors_url":"https://api.github.com/repos/Bytom/bytom/contributors","subscribers_url":"https://api.github.com/repos/Bytom/bytom/subscribers","subscription_url":"https://api.github.com/repos/Bytom/bytom/subscription","commits_url":"https://api.github.com/repos/Bytom/bytom/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bytom/bytom/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bytom/bytom/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bytom/bytom/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bytom/bytom/contents/{+path}","compare_url":"https://api.github.com/repos/Bytom/bytom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bytom/bytom/merges","archive_url":"https://api.github.com/repos/Bytom/bytom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bytom/bytom/downloads","issues_url":"https://api.github.com/repos/Bytom/bytom/issues{/number}","pulls_url":"https://api.github.com/repos/Bytom/bytom/pulls{/number}","milestones_url":"https://api.github.com/repos/Bytom/bytom/milestones{/number}","notifications_url":"https://api.github.com/repos/Bytom/bytom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bytom/bytom/labels{/name}","releases_url":"https://api.github.com/repos/Bytom/bytom/releases{/id}","deployments_url":"https://api.github.com/repos/Bytom/bytom/deployments","created_at":"2017-07-14T01:47:33Z","updated_at":"2018-03-30T17:12:40Z","pushed_at":"2018-03-31T06:05:14Z","git_url":"git://github.com/Bytom/bytom.git","ssh_url":"git@github.com:Bytom/bytom.git","clone_url":"https://github.com/Bytom/bytom.git","svn_url":"https://github.com/Bytom/bytom","homepage":"https://bytom.io/","size":47413,"stargazers_count":491,"watchers_count":491,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":149,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":149,"open_issues":24,"watchers":491,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bytom/bytom/pulls/501"},"html":{"href":"https://github.com/Bytom/bytom/pull/501"},"issue":{"href":"https://api.github.com/repos/Bytom/bytom/issues/501"},"comments":{"href":"https://api.github.com/repos/Bytom/bytom/issues/501/comments"},"review_comments":{"href":"https://api.github.com/repos/Bytom/bytom/pulls/501/comments"},"review_comment":{"href":"https://api.github.com/repos/Bytom/bytom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bytom/bytom/pulls/501/commits"},"statuses":{"href":"https://api.github.com/repos/Bytom/bytom/statuses/f265cfc10b959bdee7bfc7719c50011996a9e189"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Paladz"}}