{"action":"created","comment":{"url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/comments/136616146","pull_request_review_id":60184547,"id":136616146,"diff_hunk":"@@ -159,11 +164,46 @@ pub fn parse(matches: &clap::ArgMatches) -> Result<Config, String> {\n \t\t\tverification_level: verification_level,\n \t\t\tverification_edge: verification_edge,\n \t\t},\n+\t\tdb: db,\n \t};\n \n \tOk(config)\n }\n \n+fn parse_consensus_fork(db: &db::SharedStore, matches: &clap::ArgMatches) -> Result<ConsensusFork, String> {\n+\tlet old_consensus_fork = match db.consensus_fork() {","path":"pbtc/config.rs","position":94,"original_position":94,"commit_id":"e95802aad717a89bc8998c6fbe004e3caaa6f425","original_commit_id":"e95802aad717a89bc8998c6fbe004e3caaa6f425","user":{"login":"tomusdrw","id":581548,"avatar_url":"https://avatars1.githubusercontent.com/u/581548?v=4","gravatar_id":"","url":"https://api.github.com/users/tomusdrw","html_url":"https://github.com/tomusdrw","followers_url":"https://api.github.com/users/tomusdrw/followers","following_url":"https://api.github.com/users/tomusdrw/following{/other_user}","gists_url":"https://api.github.com/users/tomusdrw/gists{/gist_id}","starred_url":"https://api.github.com/users/tomusdrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomusdrw/subscriptions","organizations_url":"https://api.github.com/users/tomusdrw/orgs","repos_url":"https://api.github.com/users/tomusdrw/repos","events_url":"https://api.github.com/users/tomusdrw/events{/privacy}","received_events_url":"https://api.github.com/users/tomusdrw/received_events","type":"User","site_admin":false},"body":"You cannot have double `into` (one explicit and one from `?`)","created_at":"2017-09-01T16:34:49Z","updated_at":"2017-09-01T16:34:50Z","html_url":"https://github.com/paritytech/parity-bitcoin/pull/454#discussion_r136616146","pull_request_url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/comments/136616146"},"html":{"href":"https://github.com/paritytech/parity-bitcoin/pull/454#discussion_r136616146"},"pull_request":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454"}},"in_reply_to_id":136585188},"pull_request":{"url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454","id":138900660,"html_url":"https://github.com/paritytech/parity-bitcoin/pull/454","diff_url":"https://github.com/paritytech/parity-bitcoin/pull/454.diff","patch_url":"https://github.com/paritytech/parity-bitcoin/pull/454.patch","issue_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/454","number":454,"state":"open","locked":false,"title":"Force user to select chain on first run","user":{"login":"svyatonik","id":985319,"avatar_url":"https://avatars0.githubusercontent.com/u/985319?v=4","gravatar_id":"","url":"https://api.github.com/users/svyatonik","html_url":"https://github.com/svyatonik","followers_url":"https://api.github.com/users/svyatonik/followers","following_url":"https://api.github.com/users/svyatonik/following{/other_user}","gists_url":"https://api.github.com/users/svyatonik/gists{/gist_id}","starred_url":"https://api.github.com/users/svyatonik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svyatonik/subscriptions","organizations_url":"https://api.github.com/users/svyatonik/orgs","repos_url":"https://api.github.com/users/svyatonik/repos","events_url":"https://api.github.com/users/svyatonik/events{/privacy}","received_events_url":"https://api.github.com/users/svyatonik/received_events","type":"User","site_admin":false},"body":"So from now users without database or with empty database or with old version of database will receive message => \"You must select fork on first run: --segwit, --segwit2x, --bitcoin-cash\".\r\nAfter selecting fork, it can't be changed anymore. Trying to switch to another fork will lead to \"Cannot select 'segwit2x' fork with non-empty database of 'segwit' fork\"-like error.\r\nAfter first run, fork is read from database => passing flag is not required anymore.\r\n\r\nExample:\r\n```\r\nsvyatonik@xwnotebook:~/dev/parity-bitcoin.test$ rm -rf db.test\r\nsvyatonik@xwnotebook:~/dev/parity-bitcoin.test$ ./pbtc -d db.test\r\nYou must select fork on first run: --segwit, --segwit2x, --bitcoin-cash\r\nsvyatonik@xwnotebook:~/dev/parity-bitcoin.test$ ./pbtc -d db.test --segwit\r\n2017-09-01 17:13:14  INFO sync Processed 1000 blocks in 1.09 seconds (915.16 blk/s).\tPeers: 6 (act: 6, idl: 0, bad: 1).\tChain: [sch:4336 -> req:640 -> vfy:24 -> stored: 1001]\r\n2017-09-01 17:13:16  INFO sync Processed 1000 blocks in 1.19 seconds (841.61 blk/s).\tPeers: 6 (act: 5, idl: 1, bad: 1).\tChain: [sch:5440 -> req:559 -> vfy:1 -> stored: 2001]\r\n2017-09-01 17:13:17  INFO sync Processed 1000 blocks in 1.38 seconds (722.58 blk/s).\tPeers: 6 (act: 6, idl: 0, bad: 0).\tChain: [sch:4160 -> req:815 -> vfy:25 -> stored: 3001]\r\n2017-09-01 17:13:23  INFO sync Processed 1000 blocks in 5.93 seconds (168.67 blk/s).\tPeers: 6 (act: 1, idl: 5, bad: 0).\tChain: [sch:5136 -> req:0 -> vfy:864 -> stored: 4001]\r\n2017-09-01 17:13:23  INFO sync Processed 1000 blocks in 0.57 seconds (1747.58 blk/s).\tPeers: 7 (act: 2, idl: 5, bad: 1).\tChain: [sch:4368 -> req:256 -> vfy:376 -> stored: 5001]\r\n2017-09-01 17:13:25  INFO sync Processed 1000 blocks in 1.19 seconds (838.31 blk/s).\tPeers: 7 (act: 7, idl: 0, bad: 0).\tChain: [sch:4832 -> req:893 -> vfy:275 -> stored: 6001]\r\n2017-09-01 17:13:26  INFO sync Processed 1000 blocks in 1.14 seconds (879.93 blk/s).\tPeers: 7 (act: 7, idl: 0, bad: 0).\tChain: [sch:4064 -> req:875 -> vfy:61 -> stored: 7001]\r\n^C\r\nsvyatonik@xwnotebook:~/dev/parity-bitcoin.test$ ./pbtc -d db.test --segwit2x\r\nCannot select 'segwit2x' fork with non-empty database of 'segwit' fork\r\nsvyatonik@xwnotebook:~/dev/parity-bitcoin.test$ ./pbtc -d db.test\r\n2017-09-01 17:13:46  WARN sync Failed to get requested block from peer#2 in 9.48 seconds.\r\n2017-09-01 17:13:54  INFO sync Processed 1000 blocks in 16.81 seconds (59.50 blk/s).\tPeers: 9 (act: 9, idl: 0, bad: 2).\tChain: [sch:3951 -> req:896 -> vfy:153 -> stored: 8074]\r\n2017-09-01 17:13:56  WARN sync Failed to get requested block from peer#2 in 9.82 seconds.\r\n2017-09-01 17:13:57  INFO sync Processed 1000 blocks in 2.98 seconds (336.05 blk/s).\tPeers: 9 (act: 9, idl: 0, bad: 1).\tChain: [sch:4927 -> req:1024 -> vfy:49 -> stored: 9074]\r\n2017-09-01 17:14:06  WARN sync Failed to get requested block from peer#10 in 9.73 seconds.\r\n2017-09-01 17:14:06  WARN sync Failed to get requested block from peer#2 in 9.73 seconds.\r\n2017-09-01 17:14:06  WARN sync Too many header failures for peer#2. Excluding from synchronization.\r\n2017-09-01 17:14:06  WARN sync Disconnecting from peer#2 due to misbehavior: Too many header failures.\r\n2017-09-01 17:14:07  INFO sync Processed 1000 blocks in 10.08 seconds (99.25 blk/s).\tPeers: 8 (act: 0, idl: 7, bad: 1).\tChain: [sch:4415 -> req:0 -> vfy:585 -> stored: 10074]\r\n2017-09-01 17:14:07  INFO sync Processed 1000 blocks in 0.44 seconds (2271.73 blk/s).\tPeers: 8 (act: 8, idl: 0, bad: 1).\tChain: [sch:3135 -> req:733 -> vfy:132 -> stored: 11074]\r\n```","created_at":"2017-09-01T14:15:22Z","updated_at":"2017-09-01T16:34:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a68abfa13b165b938d119e1c71c3f20751e3d1d5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454/commits","review_comments_url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454/comments","review_comment_url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/454/comments","statuses_url":"https://api.github.com/repos/paritytech/parity-bitcoin/statuses/e95802aad717a89bc8998c6fbe004e3caaa6f425","head":{"label":"paritytech:mandatory_chain_selection","ref":"mandatory_chain_selection","sha":"e95802aad717a89bc8998c6fbe004e3caaa6f425","user":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":65720992,"name":"parity-bitcoin","full_name":"paritytech/parity-bitcoin","owner":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paritytech/parity-bitcoin","description":"The Parity Bitcoin client","fork":false,"url":"https://api.github.com/repos/paritytech/parity-bitcoin","forks_url":"https://api.github.com/repos/paritytech/parity-bitcoin/forks","keys_url":"https://api.github.com/repos/paritytech/parity-bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/parity-bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/parity-bitcoin/teams","hooks_url":"https://api.github.com/repos/paritytech/parity-bitcoin/hooks","issue_events_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/parity-bitcoin/events","assignees_url":"https://api.github.com/repos/paritytech/parity-bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/parity-bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/parity-bitcoin/tags","blobs_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/parity-bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/parity-bitcoin/languages","stargazers_url":"https://api.github.com/repos/paritytech/parity-bitcoin/stargazers","contributors_url":"https://api.github.com/repos/paritytech/parity-bitcoin/contributors","subscribers_url":"https://api.github.com/repos/paritytech/parity-bitcoin/subscribers","subscription_url":"https://api.github.com/repos/paritytech/parity-bitcoin/subscription","commits_url":"https://api.github.com/repos/paritytech/parity-bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/parity-bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/parity-bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/parity-bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/parity-bitcoin/merges","archive_url":"https://api.github.com/repos/paritytech/parity-bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/parity-bitcoin/downloads","issues_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/parity-bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/parity-bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/parity-bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/parity-bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/parity-bitcoin/deployments","created_at":"2016-08-15T09:30:15Z","updated_at":"2017-09-01T05:54:14Z","pushed_at":"2017-09-01T14:15:23Z","git_url":"git://github.com/paritytech/parity-bitcoin.git","ssh_url":"git@github.com:paritytech/parity-bitcoin.git","clone_url":"https://github.com/paritytech/parity-bitcoin.git","svn_url":"https://github.com/paritytech/parity-bitcoin","homepage":null,"size":17355,"stargazers_count":227,"watchers_count":227,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":33,"forks":38,"open_issues":33,"watchers":227,"default_branch":"master"}},"base":{"label":"paritytech:master","ref":"master","sha":"5a20710066ffc7871483d7b02d0d019359ca013d","user":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":65720992,"name":"parity-bitcoin","full_name":"paritytech/parity-bitcoin","owner":{"login":"paritytech","id":14176906,"avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paritytech/parity-bitcoin","description":"The Parity Bitcoin client","fork":false,"url":"https://api.github.com/repos/paritytech/parity-bitcoin","forks_url":"https://api.github.com/repos/paritytech/parity-bitcoin/forks","keys_url":"https://api.github.com/repos/paritytech/parity-bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/parity-bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/parity-bitcoin/teams","hooks_url":"https://api.github.com/repos/paritytech/parity-bitcoin/hooks","issue_events_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/parity-bitcoin/events","assignees_url":"https://api.github.com/repos/paritytech/parity-bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/parity-bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/parity-bitcoin/tags","blobs_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/parity-bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/parity-bitcoin/languages","stargazers_url":"https://api.github.com/repos/paritytech/parity-bitcoin/stargazers","contributors_url":"https://api.github.com/repos/paritytech/parity-bitcoin/contributors","subscribers_url":"https://api.github.com/repos/paritytech/parity-bitcoin/subscribers","subscription_url":"https://api.github.com/repos/paritytech/parity-bitcoin/subscription","commits_url":"https://api.github.com/repos/paritytech/parity-bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/parity-bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/parity-bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/parity-bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/parity-bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/parity-bitcoin/merges","archive_url":"https://api.github.com/repos/paritytech/parity-bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/parity-bitcoin/downloads","issues_url":"https://api.github.com/repos/paritytech/parity-bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/parity-bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/parity-bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/parity-bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/parity-bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/parity-bitcoin/deployments","created_at":"2016-08-15T09:30:15Z","updated_at":"2017-09-01T05:54:14Z","pushed_at":"2017-09-01T14:15:23Z","git_url":"git://github.com/paritytech/parity-bitcoin.git","ssh_url":"git@github.com:paritytech/parity-bitcoin.git","clone_url":"https://github.com/paritytech/parity-bitcoin.git","svn_url":"https://github.com/paritytech/parity-bitcoin","homepage":null,"size":17355,"stargazers_count":227,"watchers_count":227,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":33,"forks":38,"open_issues":33,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454"},"html":{"href":"https://github.com/paritytech/parity-bitcoin/pull/454"},"issue":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/454"},"comments":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/issues/454/comments"},"review_comments":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454/comments"},"review_comment":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/pulls/454/commits"},"statuses":{"href":"https://api.github.com/repos/paritytech/parity-bitcoin/statuses/e95802aad717a89bc8998c6fbe004e3caaa6f425"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tomusdrw"}}