{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/77986785","id":77986785,"diff_hunk":"@@ -489,6 +489,8 @@ UniValue setban(const UniValue& params, bool fHelp)\n                             + HelpExampleCli(\"setban\", \"\\\"192.168.0.0/24\\\" \\\"add\\\"\")\n                             + HelpExampleRpc(\"setban\", \"\\\"192.168.0.6\\\", \\\"add\\\", 86400\")\n                             );\n+    if(!g_connman)","path":"src/rpc/net.cpp","position":185,"original_position":4,"commit_id":"363e28d68647736ac9ddcb57a93878da5253bab9","original_commit_id":"ac198b7dc479d32862cee9c2ae9b88e88f084142","user":{"login":"sipa","id":548488,"avatar_url":"https://avatars.githubusercontent.com/u/548488?v=3","gravatar_id":"","url":"https://api.github.com/users/sipa","html_url":"https://github.com/sipa","followers_url":"https://api.github.com/users/sipa/followers","following_url":"https://api.github.com/users/sipa/following{/other_user}","gists_url":"https://api.github.com/users/sipa/gists{/gist_id}","starred_url":"https://api.github.com/users/sipa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipa/subscriptions","organizations_url":"https://api.github.com/users/sipa/orgs","repos_url":"https://api.github.com/users/sipa/repos","events_url":"https://api.github.com/users/sipa/events{/privacy}","received_events_url":"https://api.github.com/users/sipa/received_events","type":"User","site_admin":false},"body":"Style nit: space after if.","created_at":"2016-09-08T11:11:31Z","updated_at":"2016-09-08T11:11:31Z","html_url":"https://github.com/bitcoin/bitcoin/pull/8085#discussion_r77986785","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/77986785"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/8085#discussion_r77986785"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085","id":70971904,"html_url":"https://github.com/bitcoin/bitcoin/pull/8085","diff_url":"https://github.com/bitcoin/bitcoin/pull/8085.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/8085.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/8085","number":8085,"state":"open","locked":false,"title":"p2p: Begin encapsulation","user":{"login":"theuni","id":417043,"avatar_url":"https://avatars.githubusercontent.com/u/417043?v=3","gravatar_id":"","url":"https://api.github.com/users/theuni","html_url":"https://github.com/theuni","followers_url":"https://api.github.com/users/theuni/followers","following_url":"https://api.github.com/users/theuni/following{/other_user}","gists_url":"https://api.github.com/users/theuni/gists{/gist_id}","starred_url":"https://api.github.com/users/theuni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theuni/subscriptions","organizations_url":"https://api.github.com/users/theuni/orgs","repos_url":"https://api.github.com/users/theuni/repos","events_url":"https://api.github.com/users/theuni/events{/privacy}","received_events_url":"https://api.github.com/users/theuni/received_events","type":"User","site_admin":false},"body":"This work creates CConnman. The idea is to begin moving data structures and functionality out of globals in net.h and into an instanced class, in order to avoid side-effects in networking code. Eventually, an (internal) api begins to emerge, and as long as the conditions of that api are met, the inner-workings may be a black box.\r\n\r\nFor now (for ease), a single global CConnman is created. Down the road, the instance could be passed around instead. Also, CConnman should be moved out of net.h/net.cpp, but that can be done in a separate move-only-ish step.\r\n\r\nA few todos remain here:\r\n- ~~there are ```if(g_connman)```'s everywhere. A few places should assume that a connman is running (or it should be passed around). For example, ProcessMessages.~~\r\n- ~~GetRelayTx/RelayTransaction are awkward. Where should mapRelay live? Should it be dealt with directly rather than hidden inside of relay functions? (rebased on top of #8082)~~\r\n- ~~How to deal with CConnman parameters? Continue adding them to Start(), or have it parse the program options itself? (Created CConnman::Options)~~\r\n- ~~RPC needs a new error for dealing with the \"p2p not enabled\" case.~~\r\n\r\n\r\nTodos for a follow-up PR:\r\n- Actually create connman.h/cpp and move the class there.\r\n- Pass CConnman into QT similar to the wallet\r\n- ~~Drop StartNode/StopNode and just use CConnman::Stop/Start directly (Need to make sure that MapPort can be moved directly into Init without side-effects)~~\r\n- Pass CChainParams into CConnman and pass it around\r\n- ~~Create CConnmanOptions to reduce the verbosity of CConnman::Start()~~\r\n- Deal with fDiscover/fListen/etc in CConnman","created_at":"2016-05-22T09:04:33Z","updated_at":"2016-09-08T11:11:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88dd570205fb2314daa80fc94f171d4d5b001fed","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/21","html_url":"https://github.com/bitcoin/bitcoin/milestones/0.14.0","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones/21/labels","id":1823680,"number":21,"title":"0.14.0","description":"","creator":{"login":"MarcoFalke","id":6399679,"avatar_url":"https://avatars.githubusercontent.com/u/6399679?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoFalke","html_url":"https://github.com/MarcoFalke","followers_url":"https://api.github.com/users/MarcoFalke/followers","following_url":"https://api.github.com/users/MarcoFalke/following{/other_user}","gists_url":"https://api.github.com/users/MarcoFalke/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoFalke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoFalke/subscriptions","organizations_url":"https://api.github.com/users/MarcoFalke/orgs","repos_url":"https://api.github.com/users/MarcoFalke/repos","events_url":"https://api.github.com/users/MarcoFalke/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoFalke/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":2,"state":"open","created_at":"2016-06-13T14:18:51Z","updated_at":"2016-08-31T01:46:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/8085/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/363e28d68647736ac9ddcb57a93878da5253bab9","head":{"label":"theuni:net-refactor13","ref":"net-refactor13","sha":"363e28d68647736ac9ddcb57a93878da5253bab9","user":{"login":"theuni","id":417043,"avatar_url":"https://avatars.githubusercontent.com/u/417043?v=3","gravatar_id":"","url":"https://api.github.com/users/theuni","html_url":"https://github.com/theuni","followers_url":"https://api.github.com/users/theuni/followers","following_url":"https://api.github.com/users/theuni/following{/other_user}","gists_url":"https://api.github.com/users/theuni/gists{/gist_id}","starred_url":"https://api.github.com/users/theuni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theuni/subscriptions","organizations_url":"https://api.github.com/users/theuni/orgs","repos_url":"https://api.github.com/users/theuni/repos","events_url":"https://api.github.com/users/theuni/events{/privacy}","received_events_url":"https://api.github.com/users/theuni/received_events","type":"User","site_admin":false},"repo":{"id":10302141,"name":"bitcoin","full_name":"theuni/bitcoin","owner":{"login":"theuni","id":417043,"avatar_url":"https://avatars.githubusercontent.com/u/417043?v=3","gravatar_id":"","url":"https://api.github.com/users/theuni","html_url":"https://github.com/theuni","followers_url":"https://api.github.com/users/theuni/followers","following_url":"https://api.github.com/users/theuni/following{/other_user}","gists_url":"https://api.github.com/users/theuni/gists{/gist_id}","starred_url":"https://api.github.com/users/theuni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theuni/subscriptions","organizations_url":"https://api.github.com/users/theuni/orgs","repos_url":"https://api.github.com/users/theuni/repos","events_url":"https://api.github.com/users/theuni/events{/privacy}","received_events_url":"https://api.github.com/users/theuni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/theuni/bitcoin","description":"Bitcoin integration/staging tree","fork":true,"url":"https://api.github.com/repos/theuni/bitcoin","forks_url":"https://api.github.com/repos/theuni/bitcoin/forks","keys_url":"https://api.github.com/repos/theuni/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theuni/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theuni/bitcoin/teams","hooks_url":"https://api.github.com/repos/theuni/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/theuni/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/theuni/bitcoin/events","assignees_url":"https://api.github.com/repos/theuni/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/theuni/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/theuni/bitcoin/tags","blobs_url":"https://api.github.com/repos/theuni/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theuni/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theuni/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/theuni/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theuni/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/theuni/bitcoin/languages","stargazers_url":"https://api.github.com/repos/theuni/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/theuni/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/theuni/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/theuni/bitcoin/subscription","commits_url":"https://api.github.com/repos/theuni/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/theuni/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/theuni/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/theuni/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/theuni/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/theuni/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theuni/bitcoin/merges","archive_url":"https://api.github.com/repos/theuni/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theuni/bitcoin/downloads","issues_url":"https://api.github.com/repos/theuni/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/theuni/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/theuni/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/theuni/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theuni/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/theuni/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/theuni/bitcoin/deployments","created_at":"2013-05-26T18:55:06Z","updated_at":"2016-05-04T03:36:21Z","pushed_at":"2016-09-07T23:28:18Z","git_url":"git://github.com/theuni/bitcoin.git","ssh_url":"git@github.com:theuni/bitcoin.git","clone_url":"https://github.com/theuni/bitcoin.git","svn_url":"https://github.com/theuni/bitcoin","homepage":"http://www.bitcoin.org","size":76269,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":3,"default_branch":"trivial-next"}},"base":{"label":"bitcoin:master","ref":"master","sha":"84decb54f2592d543cb557bf46ce54cbcd2959e8","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2016-09-08T06:46:49Z","pushed_at":"2016-09-08T10:32:22Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":151077,"stargazers_count":9868,"watchers_count":9868,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":6574,"mirror_url":null,"open_issues_count":535,"forks":6574,"open_issues":535,"watchers":9868,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/8085"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/8085"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/8085/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/8085/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/363e28d68647736ac9ddcb57a93878da5253bab9"}}}}
{"actor":{"display_login":"sipa"}}