{"action":"closed","number":1249,"pull_request":{"url":"https://api.github.com/repos/spesmilo/electrum/pulls/1249","id":36161820,"html_url":"https://github.com/spesmilo/electrum/pull/1249","diff_url":"https://github.com/spesmilo/electrum/pull/1249.diff","patch_url":"https://github.com/spesmilo/electrum/pull/1249.patch","issue_url":"https://api.github.com/repos/spesmilo/electrum/issues/1249","number":1249,"state":"closed","locked":false,"title":"Common stale interface testing and switching","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":"Thomas - how about this?  It separates lagging and connected tests\r\nwhich seemed to be your concern.  I'm not sure I prefer it because it\r\nis more code and requires more care about where exactly lag can be\r\nintroduced.  Anyway I wanted your feedback.  Still testing locally.\r\n\r\nA new function switch_stale_interface() switches servers, optionally\r\ntaking a suggestion to switch to, the previous strategy of\r\nnew_blockchain_height().  It checks the protocol of the suggestion\r\nbefore switching.  The protocol might not match if the network has\r\njust been restarted and the prior interfaces had queued a notification.\r\n\r\nThis is called from various places that check for staleness.  Socket\r\ndisconnection is exclusively checked by check_interfaces() in the\r\nmain loop.\r\n\r\nA lagging server is checked where lag can be introduced, and\r\nin set_parameters() where auto_connect being True may have changed\r\nour ability to switch away.\r\n\r\nThe common switching logic uses the slightly more sophisticated logic\r\nof check_interfaces() that also considers disconnected servers.\r\n\r\nLagging diagnotics moved to server_is_lagging().","created_at":"2015-05-25T23:49:01Z","updated_at":"2015-05-27T08:42:59Z","closed_at":"2015-05-27T08:42:59Z","merged_at":"2015-05-27T08:42:59Z","merge_commit_sha":"1d1a6c59a7f94e5a3f82793ffb4b5e70628e3cf2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spesmilo/electrum/pulls/1249/commits","review_comments_url":"https://api.github.com/repos/spesmilo/electrum/pulls/1249/comments","review_comment_url":"https://api.github.com/repos/spesmilo/electrum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spesmilo/electrum/issues/1249/comments","statuses_url":"https://api.github.com/repos/spesmilo/electrum/statuses/45a874075511d8af4fbbb86135276627ffabfe07","head":{"label":"kyuupichan:stale_interfaces2","ref":"stale_interfaces2","sha":"45a874075511d8af4fbbb86135276627ffabfe07","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-08T06:11:09Z","pushed_at":"2015-05-27T08:16:44Z","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":12155,"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":"5ba93032915ff04de6c673c1472b4febe7bf43de","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-21T23:15:51Z","pushed_at":"2015-05-27T08:42:59Z","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":25175,"stargazers_count":565,"watchers_count":565,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":341,"mirror_url":null,"open_issues_count":47,"forks":341,"open_issues":47,"watchers":565,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/1249"},"html":{"href":"https://github.com/spesmilo/electrum/pull/1249"},"issue":{"href":"https://api.github.com/repos/spesmilo/electrum/issues/1249"},"comments":{"href":"https://api.github.com/repos/spesmilo/electrum/issues/1249/comments"},"review_comments":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/1249/comments"},"review_comment":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spesmilo/electrum/pulls/1249/commits"},"statuses":{"href":"https://api.github.com/repos/spesmilo/electrum/statuses/45a874075511d8af4fbbb86135276627ffabfe07"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ecdsa","id":2343238,"avatar_url":"https://avatars.githubusercontent.com/u/2343238?v=3","gravatar_id":"","url":"https://api.github.com/users/ecdsa","html_url":"https://github.com/ecdsa","followers_url":"https://api.github.com/users/ecdsa/followers","following_url":"https://api.github.com/users/ecdsa/following{/other_user}","gists_url":"https://api.github.com/users/ecdsa/gists{/gist_id}","starred_url":"https://api.github.com/users/ecdsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecdsa/subscriptions","organizations_url":"https://api.github.com/users/ecdsa/orgs","repos_url":"https://api.github.com/users/ecdsa/repos","events_url":"https://api.github.com/users/ecdsa/events{/privacy}","received_events_url":"https://api.github.com/users/ecdsa/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":1,"additions":20,"deletions":25,"changed_files":1}}