{"action":"opened","number":1199,"pull_request":{"url":"https://api.github.com/repos/spesmilo/electrum/pulls/1199","id":34802122,"html_url":"https://github.com/spesmilo/electrum/pull/1199","diff_url":"https://github.com/spesmilo/electrum/pull/1199.diff","patch_url":"https://github.com/spesmilo/electrum/pull/1199.patch","issue_url":"https://api.github.com/repos/spesmilo/electrum/issues/1199","number":1199,"state":"open","locked":false,"title":"Fix two races in interface.py.","user":{"login":"kyuupichan","id":3319176,"avatar_url":"https://avatars.githubusercontent.com/u/3319176?v=3","gravatar_id":"","url":"https://api.github.com/users/kyuupichan","html_url":"https://github.com/kyuupichan","followers_url":"https://api.github.com/users/kyuupichan/followers","following_url":"https://api.github.com/users/kyuupichan/following{/other_user}","gists_url":"https://api.github.com/users/kyuupichan/gists{/gist_id}","starred_url":"https://api.github.com/users/kyuupichan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyuupichan/subscriptions","organizations_url":"https://api.github.com/users/kyuupichan/orgs","repos_url":"https://api.github.com/users/kyuupichan/repos","events_url":"https://api.github.com/users/kyuupichan/events{/privacy}","received_events_url":"https://api.github.com/users/kyuupichan/received_events","type":"User","site_admin":false},"body":"First, close the socket from the thread itself rather than from\r\nthe stop() function.  This prevents another thread closing the\r\nsocket that the interface thread is simultaneously using.\r\n\r\nSecond, it was possible for the parent thread such as network.py\r\nto start() an interface, and ether immediately or after a timeout\r\non a send_request() to test is_connected() and assume the connection\r\nhas failed when the thread hasn't even been scheduled or gotten\r\naround to completing the socket connection.\r\n\r\nThe flow of control in interface.py is now reasonably clear.","created_at":"2015-05-06T09:48:41Z","updated_at":"2015-05-06T09:48:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e128f551938195de1ae2c46105062d8e9d3dbcd6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spesmilo/electrum/pulls/1199/commits","review_comments_url":"https://api.github.com/repos/spesmilo/electrum/pulls/1199/comments","review_comment_url":"https://api.github.com/repos/spesmilo/electrum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spesmilo/electrum/issues/1199/comments","statuses_url":"https://api.github.com/repos/spesmilo/electrum/statuses/5c9442fd3594f59cb931fad0402034cffd50dca7","head":{"label":"kyuupichan:if-cleanup8b","ref":"if-cleanup8b","sha":"5c9442fd3594f59cb931fad0402034cffd50dca7","user":{"login":"kyuupichan","id":3319176,"avatar_url":"https://avatars.githubusercontent.com/u/3319176?v=3","gravatar_id":"","url":"https://api.github.com/users/kyuupichan","html_url":"https://github.com/kyuupichan","followers_url":"https://api.github.com/users/kyuupichan/followers","following_url":"https://api.github.com/users/kyuupichan/following{/other_user}","gists_url":"https://api.github.com/users/kyuupichan/gists{/gist_id}","starred_url":"https://api.github.com/users/kyuupichan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyuupichan/subscriptions","organizations_url":"https://api.github.com/users/kyuupichan/orgs","repos_url":"https://api.github.com/users/kyuupichan/repos","events_url":"https://api.github.com/users/kyuupichan/events{/privacy}","received_events_url":"https://api.github.com/users/kyuupichan/received_events","type":"User","site_admin":false},"repo":{"id":32393213,"name":"electrum","full_name":"kyuupichan/electrum","owner":{"login":"kyuupichan","id":3319176,"avatar_url":"https://avatars.githubusercontent.com/u/3319176?v=3","gravatar_id":"","url":"https://api.github.com/users/kyuupichan","html_url":"https://github.com/kyuupichan","followers_url":"https://api.github.com/users/kyuupichan/followers","following_url":"https://api.github.com/users/kyuupichan/following{/other_user}","gists_url":"https://api.github.com/users/kyuupichan/gists{/gist_id}","starred_url":"https://api.github.com/users/kyuupichan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyuupichan/subscriptions","organizations_url":"https://api.github.com/users/kyuupichan/orgs","repos_url":"https://api.github.com/users/kyuupichan/repos","events_url":"https://api.github.com/users/kyuupichan/events{/privacy}","received_events_url":"https://api.github.com/users/kyuupichan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kyuupichan/electrum","description":"Electrum; Bitcoin thin client","fork":true,"url":"https://api.github.com/repos/kyuupichan/electrum","forks_url":"https://api.github.com/repos/kyuupichan/electrum/forks","keys_url":"https://api.github.com/repos/kyuupichan/electrum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kyuupichan/electrum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kyuupichan/electrum/teams","hooks_url":"https://api.github.com/repos/kyuupichan/electrum/hooks","issue_events_url":"https://api.github.com/repos/kyuupichan/electrum/issues/events{/number}","events_url":"https://api.github.com/repos/kyuupichan/electrum/events","assignees_url":"https://api.github.com/repos/kyuupichan/electrum/assignees{/user}","branches_url":"https://api.github.com/repos/kyuupichan/electrum/branches{/branch}","tags_url":"https://api.github.com/repos/kyuupichan/electrum/tags","blobs_url":"https://api.github.com/repos/kyuupichan/electrum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kyuupichan/electrum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kyuupichan/electrum/git/refs{/sha}","trees_url":"https://api.github.com/repos/kyuupichan/electrum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kyuupichan/electrum/statuses/{sha}","languages_url":"https://api.github.com/repos/kyuupichan/electrum/languages","stargazers_url":"https://api.github.com/repos/kyuupichan/electrum/stargazers","contributors_url":"https://api.github.com/repos/kyuupichan/electrum/contributors","subscribers_url":"https://api.github.com/repos/kyuupichan/electrum/subscribers","subscription_url":"https://api.github.com/repos/kyuupichan/electrum/subscription","commits_url":"https://api.github.com/repos/kyuupichan/electrum/commits{/sha}","git_commits_url":"https://api.github.com/repos/kyuupichan/electrum/git/commits{/sha}","comments_url":"https://api.github.com/repos/kyuupichan/electrum/comments{/number}","issue_comment_url":"https://api.github.com/repos/kyuupichan/electrum/issues/comments{/number}","contents_url":"https://api.github.com/repos/kyuupichan/electrum/contents/{+path}","compare_url":"https://api.github.com/repos/kyuupichan/electrum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kyuupichan/electrum/merges","archive_url":"https://api.github.com/repos/kyuupichan/electrum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kyuupichan/electrum/downloads","issues_url":"https://api.github.com/repos/kyuupichan/electrum/issues{/number}","pulls_url":"https://api.github.com/repos/kyuupichan/electrum/pulls{/number}","milestones_url":"https://api.github.com/repos/kyuupichan/electrum/milestones{/number}","notifications_url":"https://api.github.com/repos/kyuupichan/electrum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kyuupichan/electrum/labels{/name}","releases_url":"https://api.github.com/repos/kyuupichan/electrum/releases{/id}","created_at":"2015-03-17T12:55:36Z","updated_at":"2015-05-06T09:38:13Z","pushed_at":"2015-05-06T09:48:15Z","git_url":"git://github.com/kyuupichan/electrum.git","ssh_url":"git@github.com:kyuupichan/electrum.git","clone_url":"https://github.com/kyuupichan/electrum.git","svn_url":"https://github.com/kyuupichan/electrum","homepage":null,"size":11547,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"spesmilo:master","ref":"master","sha":"241b3b073ff9c5f80acc9d16e752d9b12f83666b","user":{"login":"spesmilo","id":2084673,"avatar_url":"https://avatars.githubusercontent.com/u/2084673?v=3","gravatar_id":"","url":"https://api.github.com/users/spesmilo","html_url":"https://github.com/spesmilo","followers_url":"https://api.github.com/users/spesmilo/followers","following_url":"https://api.github.com/users/spesmilo/following{/other_user}","gists_url":"https://api.github.com/users/spesmilo/gists{/gist_id}","starred_url":"https://api.github.com/users/spesmilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spesmilo/subscriptions","organizations_url":"https://api.github.com/users/spesmilo/orgs","repos_url":"https://api.github.com/users/spesmilo/repos","events_url":"https://api.github.com/users/spesmilo/events{/privacy}","received_events_url":"https://api.github.com/users/spesmilo/received_events","type":"Organization","site_admin":false},"repo":{"id":5274894,"name":"electrum","full_name":"spesmilo/electrum","owner":{"login":"spesmilo","id":2084673,"avatar_url":"https://avatars.githubusercontent.com/u/2084673?v=3","gravatar_id":"","url":"https://api.github.com/users/spesmilo","html_url":"https://github.com/spesmilo","followers_url":"https://api.github.com/users/spesmilo/followers","following_url":"https://api.github.com/users/spesmilo/following{/other_user}","gists_url":"https://api.github.com/users/spesmilo/gists{/gist_id}","starred_url":"https://api.github.com/users/spesmilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spesmilo/subscriptions","organizations_url":"https://api.github.com/users/spesmilo/orgs","repos_url":"https://api.github.com/users/spesmilo/repos","events_url":"https://api.github.com/users/spesmilo/events{/privacy}","received_events_url":"https://api.github.com/users/spesmilo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spesmilo/electrum","description":"Electrum; Bitcoin thin client","fork":false,"url":"https://api.github.com/repos/spesmilo/electrum","forks_url":"https://api.github.com/repos/spesmilo/electrum/forks","keys_url":"https://api.github.com/repos/spesmilo/electrum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spesmilo/electrum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spesmilo/electrum/teams","hooks_url":"https://api.github.com/repos/spesmilo/electrum/hooks","issue_events_url":"https://api.github.com/repos/spesmilo/electrum/issues/events{/number}","events_url":"https://api.github.com/repos/spesmilo/electrum/events","assignees_url":"https://api.github.com/repos/spesmilo/electrum/assignees{/user}","branches_url":"https://api.github.com/repos/spesmilo/electrum/branches{/branch}","tags_url":"https://api.github.com/repos/spesmilo/electrum/tags","blobs_url":"https://api.github.com/repos/spesmilo/electrum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spesmilo/electrum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spesmilo/electrum/git/refs{/sha}","trees_url":"https://api.github.com/repos/spesmilo/electrum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spesmilo/electrum/statuses/{sha}","languages_url":"https://api.github.com/repos/spesmilo/electrum/languages","stargazers_url":"https://api.github.com/repos/spesmilo/electrum/stargazers","contributors_url":"https://api.github.com/repos/spesmilo/electrum/contributors","subscribers_url":"https://api.github.com/repos/spesmilo/electrum/subscribers","subscription_url":"https://api.github.com/repos/spesmilo/electrum/subscription","commits_url":"https://api.github.com/repos/spesmilo/electrum/commits{/sha}","git_commits_url":"https://api.github.com/repos/spesmilo/electrum/git/commits{/sha}","comments_url":"https://api.github.com/repos/spesmilo/electrum/comments{/number}","issue_comment_url":"https://api.github.com/repos/spesmilo/electrum/issues/comments{/number}","contents_url":"https://api.github.com/repos/spesmilo/electrum/contents/{+path}","compare_url":"https://api.github.com/repos/spesmilo/electrum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spesmilo/electrum/merges","archive_url":"https://api.github.com/repos/spesmilo/electrum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spesmilo/electrum/downloads","issues_url":"https://api.github.com/repos/spesmilo/electrum/issues{/number}","pulls_url":"https://api.github.com/repos/spesmilo/electrum/pulls{/number}","milestones_url":"https://api.github.com/repos/spesmilo/electrum/milestones{/number}","notifications_url":"https://api.github.com/repos/spesmilo/electrum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spesmilo/electrum/labels{/name}","releases_url":"https://api.github.com/repos/spesmilo/electrum/releases{/id}","created_at":"2012-08-02T16:24:30Z","updated_at":"2015-05-06T09:28:04Z","pushed_at":"2015-05-06T09:48:42Z","git_url":"git://github.com/spesmilo/electrum.git","ssh_url":"git@github.com:spesmilo/electrum.git","clone_url":"https://github.com/spesmilo/electrum.git","svn_url":"https://github.com/spesmilo/electrum","homepage":null,"size":24277,"stargazers_count":558,"watchers_count":558,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":337,"mirror_url":null,"open_issues_count":49,"forks":337,"open_issues":49,"watchers":558,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/1199"},"html":{"href":"https://github.com/spesmilo/electrum/pull/1199"},"issue":{"href":"https://api.github.com/repos/spesmilo/electrum/issues/1199"},"comments":{"href":"https://api.github.com/repos/spesmilo/electrum/issues/1199/comments"},"review_comments":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/1199/comments"},"review_comment":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/1199/commits"},"statuses":{"href":"https://api.github.com/repos/spesmilo/electrum/statuses/5c9442fd3594f59cb931fad0402034cffd50dca7"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":31,"deletions":23,"changed_files":1}}