{"action":"created","comment":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/66917753","id":66917753,"diff_hunk":"@@ -158,6 +162,14 @@ func (m *Miner) managedSubmitBlock(b types.Block) error {\n \n // SubmitHeader accepts a block header.\n func (m *Miner) SubmitHeader(bh types.BlockHeader) error {\n+\tif err := m.tg.Add(); err != nil {","path":"modules/miner/blockmanager.go","position":22,"original_position":22,"commit_id":"d1f99e040c433c661864aec78db5ee58ac473d62","original_commit_id":"d1f99e040c433c661864aec78db5ee58ac473d62","user":{"login":"DavidVorick","id":2316841,"avatar_url":"https://avatars.githubusercontent.com/u/2316841?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidVorick","html_url":"https://github.com/DavidVorick","followers_url":"https://api.github.com/users/DavidVorick/followers","following_url":"https://api.github.com/users/DavidVorick/following{/other_user}","gists_url":"https://api.github.com/users/DavidVorick/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidVorick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidVorick/subscriptions","organizations_url":"https://api.github.com/users/DavidVorick/orgs","repos_url":"https://api.github.com/users/DavidVorick/repos","events_url":"https://api.github.com/users/DavidVorick/events{/privacy}","received_events_url":"https://api.github.com/users/DavidVorick/received_events","type":"User","site_admin":false},"body":"gah forgot that `tg.Add` checked `IsStopped` for you.","created_at":"2016-06-14T07:02:00Z","updated_at":"2016-06-14T07:02:00Z","html_url":"https://github.com/NebulousLabs/Sia/pull/1224#discussion_r66917753","pull_request_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224","_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/66917753"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/1224#discussion_r66917753"},"pull_request":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224"}}},"pull_request":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224","id":72806020,"html_url":"https://github.com/NebulousLabs/Sia/pull/1224","diff_url":"https://github.com/NebulousLabs/Sia/pull/1224.diff","patch_url":"https://github.com/NebulousLabs/Sia/pull/1224.patch","issue_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/1224","number":1224,"state":"open","locked":false,"title":"Clean shutdown of miner","user":{"login":"mnsl","id":14918275,"avatar_url":"https://avatars.githubusercontent.com/u/14918275?v=3","gravatar_id":"","url":"https://api.github.com/users/mnsl","html_url":"https://github.com/mnsl","followers_url":"https://api.github.com/users/mnsl/followers","following_url":"https://api.github.com/users/mnsl/following{/other_user}","gists_url":"https://api.github.com/users/mnsl/gists{/gist_id}","starred_url":"https://api.github.com/users/mnsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnsl/subscriptions","organizations_url":"https://api.github.com/users/mnsl/orgs","repos_url":"https://api.github.com/users/mnsl/repos","events_url":"https://api.github.com/users/mnsl/events{/privacy}","received_events_url":"https://api.github.com/users/mnsl/received_events","type":"User","site_admin":false},"body":"Adds `tg *siasync.ThreadGroup` field to the Miner type; m.tg.Stop() is called at the start of m.Close(), automatically unsubscribing the miner from its consensus set and transaction pool and blocking until the m.threadedMine() goroutine is done.\r\n\r\nTo unsubscribe the miner from the transaction pool, I've added an exported Unsubscribe method to TransactionPool (akin to the ConsensusSet Unsubscribe method).","created_at":"2016-06-07T02:10:39Z","updated_at":"2016-06-14T07:02:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"526a39fec77bfe480ee2bb51db048448227dc76c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224/commits","review_comments_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224/comments","review_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/1224/comments","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/d1f99e040c433c661864aec78db5ee58ac473d62","head":{"label":"mnsl:minershutdown","ref":"minershutdown","sha":"d1f99e040c433c661864aec78db5ee58ac473d62","user":{"login":"mnsl","id":14918275,"avatar_url":"https://avatars.githubusercontent.com/u/14918275?v=3","gravatar_id":"","url":"https://api.github.com/users/mnsl","html_url":"https://github.com/mnsl","followers_url":"https://api.github.com/users/mnsl/followers","following_url":"https://api.github.com/users/mnsl/following{/other_user}","gists_url":"https://api.github.com/users/mnsl/gists{/gist_id}","starred_url":"https://api.github.com/users/mnsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnsl/subscriptions","organizations_url":"https://api.github.com/users/mnsl/orgs","repos_url":"https://api.github.com/users/mnsl/repos","events_url":"https://api.github.com/users/mnsl/events{/privacy}","received_events_url":"https://api.github.com/users/mnsl/received_events","type":"User","site_admin":false},"repo":{"id":56559741,"name":"Sia","full_name":"mnsl/Sia","owner":{"login":"mnsl","id":14918275,"avatar_url":"https://avatars.githubusercontent.com/u/14918275?v=3","gravatar_id":"","url":"https://api.github.com/users/mnsl","html_url":"https://github.com/mnsl","followers_url":"https://api.github.com/users/mnsl/followers","following_url":"https://api.github.com/users/mnsl/following{/other_user}","gists_url":"https://api.github.com/users/mnsl/gists{/gist_id}","starred_url":"https://api.github.com/users/mnsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnsl/subscriptions","organizations_url":"https://api.github.com/users/mnsl/orgs","repos_url":"https://api.github.com/users/mnsl/repos","events_url":"https://api.github.com/users/mnsl/events{/privacy}","received_events_url":"https://api.github.com/users/mnsl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mnsl/Sia","description":"Blockchain-based marketplace for file storage","fork":true,"url":"https://api.github.com/repos/mnsl/Sia","forks_url":"https://api.github.com/repos/mnsl/Sia/forks","keys_url":"https://api.github.com/repos/mnsl/Sia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mnsl/Sia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mnsl/Sia/teams","hooks_url":"https://api.github.com/repos/mnsl/Sia/hooks","issue_events_url":"https://api.github.com/repos/mnsl/Sia/issues/events{/number}","events_url":"https://api.github.com/repos/mnsl/Sia/events","assignees_url":"https://api.github.com/repos/mnsl/Sia/assignees{/user}","branches_url":"https://api.github.com/repos/mnsl/Sia/branches{/branch}","tags_url":"https://api.github.com/repos/mnsl/Sia/tags","blobs_url":"https://api.github.com/repos/mnsl/Sia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mnsl/Sia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mnsl/Sia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mnsl/Sia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mnsl/Sia/statuses/{sha}","languages_url":"https://api.github.com/repos/mnsl/Sia/languages","stargazers_url":"https://api.github.com/repos/mnsl/Sia/stargazers","contributors_url":"https://api.github.com/repos/mnsl/Sia/contributors","subscribers_url":"https://api.github.com/repos/mnsl/Sia/subscribers","subscription_url":"https://api.github.com/repos/mnsl/Sia/subscription","commits_url":"https://api.github.com/repos/mnsl/Sia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mnsl/Sia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mnsl/Sia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mnsl/Sia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mnsl/Sia/contents/{+path}","compare_url":"https://api.github.com/repos/mnsl/Sia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mnsl/Sia/merges","archive_url":"https://api.github.com/repos/mnsl/Sia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mnsl/Sia/downloads","issues_url":"https://api.github.com/repos/mnsl/Sia/issues{/number}","pulls_url":"https://api.github.com/repos/mnsl/Sia/pulls{/number}","milestones_url":"https://api.github.com/repos/mnsl/Sia/milestones{/number}","notifications_url":"https://api.github.com/repos/mnsl/Sia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mnsl/Sia/labels{/name}","releases_url":"https://api.github.com/repos/mnsl/Sia/releases{/id}","deployments_url":"https://api.github.com/repos/mnsl/Sia/deployments","created_at":"2016-04-19T02:56:00Z","updated_at":"2016-04-19T02:56:03Z","pushed_at":"2016-06-10T02:36:13Z","git_url":"git://github.com/mnsl/Sia.git","ssh_url":"git@github.com:mnsl/Sia.git","clone_url":"https://github.com/mnsl/Sia.git","svn_url":"https://github.com/mnsl/Sia","homepage":"https://sia.tech","size":7893,"stargazers_count":0,"watchers_count":0,"language":"Go","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":0,"default_branch":"master"}},"base":{"label":"NebulousLabs:master","ref":"master","sha":"02fb770750952d7f1edd5060bce04682198ac448","user":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":25370072,"name":"Sia","full_name":"NebulousLabs/Sia","owner":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NebulousLabs/Sia","description":"Blockchain-based marketplace for file storage","fork":false,"url":"https://api.github.com/repos/NebulousLabs/Sia","forks_url":"https://api.github.com/repos/NebulousLabs/Sia/forks","keys_url":"https://api.github.com/repos/NebulousLabs/Sia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NebulousLabs/Sia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NebulousLabs/Sia/teams","hooks_url":"https://api.github.com/repos/NebulousLabs/Sia/hooks","issue_events_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/events{/number}","events_url":"https://api.github.com/repos/NebulousLabs/Sia/events","assignees_url":"https://api.github.com/repos/NebulousLabs/Sia/assignees{/user}","branches_url":"https://api.github.com/repos/NebulousLabs/Sia/branches{/branch}","tags_url":"https://api.github.com/repos/NebulousLabs/Sia/tags","blobs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NebulousLabs/Sia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/refs{/sha}","trees_url":"https://api.github.com/repos/NebulousLabs/Sia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/{sha}","languages_url":"https://api.github.com/repos/NebulousLabs/Sia/languages","stargazers_url":"https://api.github.com/repos/NebulousLabs/Sia/stargazers","contributors_url":"https://api.github.com/repos/NebulousLabs/Sia/contributors","subscribers_url":"https://api.github.com/repos/NebulousLabs/Sia/subscribers","subscription_url":"https://api.github.com/repos/NebulousLabs/Sia/subscription","commits_url":"https://api.github.com/repos/NebulousLabs/Sia/commits{/sha}","git_commits_url":"https://api.github.com/repos/NebulousLabs/Sia/git/commits{/sha}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/comments{/number}","issue_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/comments{/number}","contents_url":"https://api.github.com/repos/NebulousLabs/Sia/contents/{+path}","compare_url":"https://api.github.com/repos/NebulousLabs/Sia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NebulousLabs/Sia/merges","archive_url":"https://api.github.com/repos/NebulousLabs/Sia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NebulousLabs/Sia/downloads","issues_url":"https://api.github.com/repos/NebulousLabs/Sia/issues{/number}","pulls_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls{/number}","milestones_url":"https://api.github.com/repos/NebulousLabs/Sia/milestones{/number}","notifications_url":"https://api.github.com/repos/NebulousLabs/Sia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NebulousLabs/Sia/labels{/name}","releases_url":"https://api.github.com/repos/NebulousLabs/Sia/releases{/id}","deployments_url":"https://api.github.com/repos/NebulousLabs/Sia/deployments","created_at":"2014-10-17T17:50:25Z","updated_at":"2016-06-14T05:08:00Z","pushed_at":"2016-06-13T22:53:47Z","git_url":"git://github.com/NebulousLabs/Sia.git","ssh_url":"git@github.com:NebulousLabs/Sia.git","clone_url":"https://github.com/NebulousLabs/Sia.git","svn_url":"https://github.com/NebulousLabs/Sia","homepage":"https://sia.tech","size":28990,"stargazers_count":234,"watchers_count":234,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":77,"forks":37,"open_issues":77,"watchers":234,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/1224"},"issue":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/1224"},"comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/1224/comments"},"review_comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224/comments"},"review_comment":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1224/commits"},"statuses":{"href":"https://api.github.com/repos/NebulousLabs/Sia/statuses/d1f99e040c433c661864aec78db5ee58ac473d62"}}}}
{"actor":{"display_login":"DavidVorick"}}