{"action":"created","comment":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/93163429","pull_request_review_id":13685096,"id":93163429,"diff_hunk":"@@ -147,12 +148,10 @@ func (c *Contractor) SetAllowance(a modules.Allowance) error {\n \tc.mu.Lock()\n \tc.allowance = a\n \tc.contracts = newContracts\n-\t// update metrics\n-\tvar spending types.Currency\n-\tfor _, contract := range c.contracts {\n-\t\tspending = spending.Add(contract.RenterFunds())\n+\t// if the currentPeriod was previously unset, set it now\n+\tif c.currentPeriod == 0 {\n+\t\tc.currentPeriod = periodStart","path":"modules/renter/contractor/allowance.go","position":29,"original_position":29,"commit_id":"6e142a631b322336a8ead03a95e5bbb64ef832a2","original_commit_id":"6e142a631b322336a8ead03a95e5bbb64ef832a2","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":"should it only be updating to a new period if there isn't currently a period? Should it update any time that the renewWindow changes?\r\n\r\nhmm. I guess that's probably too much detail/stress for this PR. We'll leave it for now but I'm thinking that we'll be coming back to it in the future.","created_at":"2016-12-20T02:51:47Z","updated_at":"2016-12-20T02:51:47Z","html_url":"https://github.com/NebulousLabs/Sia/pull/1524#discussion_r93163429","pull_request_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524","_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/93163429"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/1524#discussion_r93163429"},"pull_request":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524"}}},"pull_request":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524","id":98432884,"html_url":"https://github.com/NebulousLabs/Sia/pull/1524","diff_url":"https://github.com/NebulousLabs/Sia/pull/1524.diff","patch_url":"https://github.com/NebulousLabs/Sia/pull/1524.patch","issue_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/1524","number":1524,"state":"open","locked":false,"title":"Unspent allowance","user":{"login":"lukechampine","id":3344749,"avatar_url":"https://avatars.githubusercontent.com/u/3344749?v=3","gravatar_id":"","url":"https://api.github.com/users/lukechampine","html_url":"https://github.com/lukechampine","followers_url":"https://api.github.com/users/lukechampine/followers","following_url":"https://api.github.com/users/lukechampine/following{/other_user}","gists_url":"https://api.github.com/users/lukechampine/gists{/gist_id}","starred_url":"https://api.github.com/users/lukechampine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukechampine/subscriptions","organizations_url":"https://api.github.com/users/lukechampine/orgs","repos_url":"https://api.github.com/users/lukechampine/repos","events_url":"https://api.github.com/users/lukechampine/events{/privacy}","received_events_url":"https://api.github.com/users/lukechampine/received_events","type":"User","site_admin":false},"body":"This took longer than expected because I had to track down a bug in the metrics reporting. The commit is pretty self-explanatory.\r\n\r\nThe only open question here is when to reset the metrics. I believe they should be reset as soon as we renew the first contract in a new allowance period, but how do we know when that is? We may need to keep track of `periodStart`, as before.","created_at":"2016-12-17T04:30:32Z","updated_at":"2016-12-20T02:51:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c153ec67c1f28b3a034012713992880a40688527","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524/commits","review_comments_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524/comments","review_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/1524/comments","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/6e142a631b322336a8ead03a95e5bbb64ef832a2","head":{"label":"NebulousLabs:renter-unspent","ref":"renter-unspent","sha":"6e142a631b322336a8ead03a95e5bbb64ef832a2","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-12-18T02:18:03Z","pushed_at":"2016-12-20T00:25:31Z","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":10049,"stargazers_count":423,"watchers_count":423,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"open_issues_count":76,"forks":69,"open_issues":76,"watchers":423,"default_branch":"master"}},"base":{"label":"NebulousLabs:master","ref":"master","sha":"7aeb3a9502125665f79f83010a8b8ad2467f0b68","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-12-18T02:18:03Z","pushed_at":"2016-12-20T00:25:31Z","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":10049,"stargazers_count":423,"watchers_count":423,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"open_issues_count":76,"forks":69,"open_issues":76,"watchers":423,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/1524"},"issue":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/1524"},"comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/1524/comments"},"review_comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524/comments"},"review_comment":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/1524/commits"},"statuses":{"href":"https://api.github.com/repos/NebulousLabs/Sia/statuses/6e142a631b322336a8ead03a95e5bbb64ef832a2"}}}}
{"actor":{"display_login":"DavidVorick"}}