{"action":"created","comment":{"url":"https://api.github.com/repos/loki-project/loki/pulls/comments/208063653","pull_request_review_id":143793530,"id":208063653,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODA2MzY1Mw==","diff_hunk":"@@ -88,16 +91,19 @@ namespace service_nodes\n \n       uint64_t last_reward_block_height;\n       uint32_t last_reward_transaction_index;\n-      std::vector<cryptonote::account_public_address> addresses;\n-      std::vector<uint32_t> portions;\n-      std::vector<contribution> contributions;\n-      uint64_t total_contributions;\n+\n+      std::unordered_map<cryptonote::account_public_address, contribution> contributors;\n+      uint64_t total_contributed;\n+      uint64_t total_reserved;\n       uint64_t staking_requirement;\n \n-      bool is_fully_funded() const { return total_contributions >= staking_requirement; }\n+      bool is_fully_funded() const { return total_contributed >= staking_requirement; }\n+      // the minimum contribution to start a new contributor\n+      uint64_t get_min_contribution() { return std::min(staking_requirement - total_reserved, staking_requirement / MAX_NUMBER_OF_CONTRIBUTORS); }","path":"src/cryptonote_core/service_node_list.h","position":32,"original_position":32,"commit_id":"1e90128a1dd13fa59ca4c2f2d5c9d764189eb0c9","original_commit_id":"1e90128a1dd13fa59ca4c2f2d5c9d764189eb0c9","user":{"login":"sachaaaaa","id":40749766,"node_id":"MDQ6VXNlcjQwNzQ5NzY2","avatar_url":"https://avatars2.githubusercontent.com/u/40749766?v=4","gravatar_id":"","url":"https://api.github.com/users/sachaaaaa","html_url":"https://github.com/sachaaaaa","followers_url":"https://api.github.com/users/sachaaaaa/followers","following_url":"https://api.github.com/users/sachaaaaa/following{/other_user}","gists_url":"https://api.github.com/users/sachaaaaa/gists{/gist_id}","starred_url":"https://api.github.com/users/sachaaaaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sachaaaaa/subscriptions","organizations_url":"https://api.github.com/users/sachaaaaa/orgs","repos_url":"https://api.github.com/users/sachaaaaa/repos","events_url":"https://api.github.com/users/sachaaaaa/events{/privacy}","received_events_url":"https://api.github.com/users/sachaaaaa/received_events","type":"User","site_admin":false},"body":"This method could be `const` as well","created_at":"2018-08-07T00:07:03Z","updated_at":"2018-08-07T00:30:12Z","html_url":"https://github.com/loki-project/loki/pull/119#discussion_r208063653","pull_request_url":"https://api.github.com/repos/loki-project/loki/pulls/119","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/loki-project/loki/pulls/comments/208063653"},"html":{"href":"https://github.com/loki-project/loki/pull/119#discussion_r208063653"},"pull_request":{"href":"https://api.github.com/repos/loki-project/loki/pulls/119"}}},"pull_request":{"url":"https://api.github.com/repos/loki-project/loki/pulls/119","id":206402509,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDAyNTA5","html_url":"https://github.com/loki-project/loki/pull/119","diff_url":"https://github.com/loki-project/loki/pull/119.diff","patch_url":"https://github.com/loki-project/loki/pull/119.patch","issue_url":"https://api.github.com/repos/loki-project/loki/issues/119","number":119,"state":"open","locked":false,"title":"new and improved contribution system","user":{"login":"jcktm","id":9440750,"node_id":"MDQ6VXNlcjk0NDA3NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/9440750?v=4","gravatar_id":"","url":"https://api.github.com/users/jcktm","html_url":"https://github.com/jcktm","followers_url":"https://api.github.com/users/jcktm/followers","following_url":"https://api.github.com/users/jcktm/following{/other_user}","gists_url":"https://api.github.com/users/jcktm/gists{/gist_id}","starred_url":"https://api.github.com/users/jcktm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcktm/subscriptions","organizations_url":"https://api.github.com/users/jcktm/orgs","repos_url":"https://api.github.com/users/jcktm/repos","events_url":"https://api.github.com/users/jcktm/events{/privacy}","received_events_url":"https://api.github.com/users/jcktm/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-06T13:40:29Z","updated_at":"2018-08-07T00:30:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3364e7533401b4cc901d90d45fc2221577881741","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Doy-lee","id":12163539,"node_id":"MDQ6VXNlcjEyMTYzNTM5","avatar_url":"https://avatars1.githubusercontent.com/u/12163539?v=4","gravatar_id":"","url":"https://api.github.com/users/Doy-lee","html_url":"https://github.com/Doy-lee","followers_url":"https://api.github.com/users/Doy-lee/followers","following_url":"https://api.github.com/users/Doy-lee/following{/other_user}","gists_url":"https://api.github.com/users/Doy-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/Doy-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doy-lee/subscriptions","organizations_url":"https://api.github.com/users/Doy-lee/orgs","repos_url":"https://api.github.com/users/Doy-lee/repos","events_url":"https://api.github.com/users/Doy-lee/events{/privacy}","received_events_url":"https://api.github.com/users/Doy-lee/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/loki-project/loki/pulls/119/commits","review_comments_url":"https://api.github.com/repos/loki-project/loki/pulls/119/comments","review_comment_url":"https://api.github.com/repos/loki-project/loki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/loki-project/loki/issues/119/comments","statuses_url":"https://api.github.com/repos/loki-project/loki/statuses/1e90128a1dd13fa59ca4c2f2d5c9d764189eb0c9","head":{"label":"jcktm:new-and-improved-contribution-system","ref":"new-and-improved-contribution-system","sha":"1e90128a1dd13fa59ca4c2f2d5c9d764189eb0c9","user":{"login":"jcktm","id":9440750,"node_id":"MDQ6VXNlcjk0NDA3NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/9440750?v=4","gravatar_id":"","url":"https://api.github.com/users/jcktm","html_url":"https://github.com/jcktm","followers_url":"https://api.github.com/users/jcktm/followers","following_url":"https://api.github.com/users/jcktm/following{/other_user}","gists_url":"https://api.github.com/users/jcktm/gists{/gist_id}","starred_url":"https://api.github.com/users/jcktm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcktm/subscriptions","organizations_url":"https://api.github.com/users/jcktm/orgs","repos_url":"https://api.github.com/users/jcktm/repos","events_url":"https://api.github.com/users/jcktm/events{/privacy}","received_events_url":"https://api.github.com/users/jcktm/received_events","type":"User","site_admin":false},"repo":{"id":129197871,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkxOTc4NzE=","name":"loki","full_name":"jcktm/loki","owner":{"login":"jcktm","id":9440750,"node_id":"MDQ6VXNlcjk0NDA3NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/9440750?v=4","gravatar_id":"","url":"https://api.github.com/users/jcktm","html_url":"https://github.com/jcktm","followers_url":"https://api.github.com/users/jcktm/followers","following_url":"https://api.github.com/users/jcktm/following{/other_user}","gists_url":"https://api.github.com/users/jcktm/gists{/gist_id}","starred_url":"https://api.github.com/users/jcktm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcktm/subscriptions","organizations_url":"https://api.github.com/users/jcktm/orgs","repos_url":"https://api.github.com/users/jcktm/repos","events_url":"https://api.github.com/users/jcktm/events{/privacy}","received_events_url":"https://api.github.com/users/jcktm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcktm/loki","description":"Loki: Trade and communicate with freedom. (Testnet only)","fork":true,"url":"https://api.github.com/repos/jcktm/loki","forks_url":"https://api.github.com/repos/jcktm/loki/forks","keys_url":"https://api.github.com/repos/jcktm/loki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcktm/loki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcktm/loki/teams","hooks_url":"https://api.github.com/repos/jcktm/loki/hooks","issue_events_url":"https://api.github.com/repos/jcktm/loki/issues/events{/number}","events_url":"https://api.github.com/repos/jcktm/loki/events","assignees_url":"https://api.github.com/repos/jcktm/loki/assignees{/user}","branches_url":"https://api.github.com/repos/jcktm/loki/branches{/branch}","tags_url":"https://api.github.com/repos/jcktm/loki/tags","blobs_url":"https://api.github.com/repos/jcktm/loki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcktm/loki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcktm/loki/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcktm/loki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcktm/loki/statuses/{sha}","languages_url":"https://api.github.com/repos/jcktm/loki/languages","stargazers_url":"https://api.github.com/repos/jcktm/loki/stargazers","contributors_url":"https://api.github.com/repos/jcktm/loki/contributors","subscribers_url":"https://api.github.com/repos/jcktm/loki/subscribers","subscription_url":"https://api.github.com/repos/jcktm/loki/subscription","commits_url":"https://api.github.com/repos/jcktm/loki/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcktm/loki/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcktm/loki/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcktm/loki/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcktm/loki/contents/{+path}","compare_url":"https://api.github.com/repos/jcktm/loki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcktm/loki/merges","archive_url":"https://api.github.com/repos/jcktm/loki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcktm/loki/downloads","issues_url":"https://api.github.com/repos/jcktm/loki/issues{/number}","pulls_url":"https://api.github.com/repos/jcktm/loki/pulls{/number}","milestones_url":"https://api.github.com/repos/jcktm/loki/milestones{/number}","notifications_url":"https://api.github.com/repos/jcktm/loki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcktm/loki/labels{/name}","releases_url":"https://api.github.com/repos/jcktm/loki/releases{/id}","deployments_url":"https://api.github.com/repos/jcktm/loki/deployments","created_at":"2018-04-12T05:27:03Z","updated_at":"2018-04-13T02:32:27Z","pushed_at":"2018-08-06T23:03:10Z","git_url":"git://github.com/jcktm/loki.git","ssh_url":"git@github.com:jcktm/loki.git","clone_url":"https://github.com/jcktm/loki.git","svn_url":"https://github.com/jcktm/loki","homepage":"https://loki.network","size":144043,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"loki-project:dev","ref":"dev","sha":"91395745cc2fc81b196912893aed223fb42f22e9","user":{"login":"loki-project","id":35471049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NDcxMDQ5","avatar_url":"https://avatars0.githubusercontent.com/u/35471049?v=4","gravatar_id":"","url":"https://api.github.com/users/loki-project","html_url":"https://github.com/loki-project","followers_url":"https://api.github.com/users/loki-project/followers","following_url":"https://api.github.com/users/loki-project/following{/other_user}","gists_url":"https://api.github.com/users/loki-project/gists{/gist_id}","starred_url":"https://api.github.com/users/loki-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loki-project/subscriptions","organizations_url":"https://api.github.com/users/loki-project/orgs","repos_url":"https://api.github.com/users/loki-project/repos","events_url":"https://api.github.com/users/loki-project/events{/privacy}","received_events_url":"https://api.github.com/users/loki-project/received_events","type":"Organization","site_admin":false},"repo":{"id":117603764,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc2MDM3NjQ=","name":"loki","full_name":"loki-project/loki","owner":{"login":"loki-project","id":35471049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NDcxMDQ5","avatar_url":"https://avatars0.githubusercontent.com/u/35471049?v=4","gravatar_id":"","url":"https://api.github.com/users/loki-project","html_url":"https://github.com/loki-project","followers_url":"https://api.github.com/users/loki-project/followers","following_url":"https://api.github.com/users/loki-project/following{/other_user}","gists_url":"https://api.github.com/users/loki-project/gists{/gist_id}","starred_url":"https://api.github.com/users/loki-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loki-project/subscriptions","organizations_url":"https://api.github.com/users/loki-project/orgs","repos_url":"https://api.github.com/users/loki-project/repos","events_url":"https://api.github.com/users/loki-project/events{/privacy}","received_events_url":"https://api.github.com/users/loki-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/loki-project/loki","description":"Loki: Trade and communicate with freedom.","fork":true,"url":"https://api.github.com/repos/loki-project/loki","forks_url":"https://api.github.com/repos/loki-project/loki/forks","keys_url":"https://api.github.com/repos/loki-project/loki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loki-project/loki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loki-project/loki/teams","hooks_url":"https://api.github.com/repos/loki-project/loki/hooks","issue_events_url":"https://api.github.com/repos/loki-project/loki/issues/events{/number}","events_url":"https://api.github.com/repos/loki-project/loki/events","assignees_url":"https://api.github.com/repos/loki-project/loki/assignees{/user}","branches_url":"https://api.github.com/repos/loki-project/loki/branches{/branch}","tags_url":"https://api.github.com/repos/loki-project/loki/tags","blobs_url":"https://api.github.com/repos/loki-project/loki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loki-project/loki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loki-project/loki/git/refs{/sha}","trees_url":"https://api.github.com/repos/loki-project/loki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loki-project/loki/statuses/{sha}","languages_url":"https://api.github.com/repos/loki-project/loki/languages","stargazers_url":"https://api.github.com/repos/loki-project/loki/stargazers","contributors_url":"https://api.github.com/repos/loki-project/loki/contributors","subscribers_url":"https://api.github.com/repos/loki-project/loki/subscribers","subscription_url":"https://api.github.com/repos/loki-project/loki/subscription","commits_url":"https://api.github.com/repos/loki-project/loki/commits{/sha}","git_commits_url":"https://api.github.com/repos/loki-project/loki/git/commits{/sha}","comments_url":"https://api.github.com/repos/loki-project/loki/comments{/number}","issue_comment_url":"https://api.github.com/repos/loki-project/loki/issues/comments{/number}","contents_url":"https://api.github.com/repos/loki-project/loki/contents/{+path}","compare_url":"https://api.github.com/repos/loki-project/loki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loki-project/loki/merges","archive_url":"https://api.github.com/repos/loki-project/loki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loki-project/loki/downloads","issues_url":"https://api.github.com/repos/loki-project/loki/issues{/number}","pulls_url":"https://api.github.com/repos/loki-project/loki/pulls{/number}","milestones_url":"https://api.github.com/repos/loki-project/loki/milestones{/number}","notifications_url":"https://api.github.com/repos/loki-project/loki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loki-project/loki/labels{/name}","releases_url":"https://api.github.com/repos/loki-project/loki/releases{/id}","deployments_url":"https://api.github.com/repos/loki-project/loki/deployments","created_at":"2018-01-15T22:50:09Z","updated_at":"2018-08-03T07:05:25Z","pushed_at":"2018-08-06T13:40:29Z","git_url":"git://github.com/loki-project/loki.git","ssh_url":"git@github.com:loki-project/loki.git","clone_url":"https://github.com/loki-project/loki.git","svn_url":"https://github.com/loki-project/loki","homepage":"https://loki.network","size":143605,"stargazers_count":42,"watchers_count":42,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":23,"open_issues":10,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/loki-project/loki/pulls/119"},"html":{"href":"https://github.com/loki-project/loki/pull/119"},"issue":{"href":"https://api.github.com/repos/loki-project/loki/issues/119"},"comments":{"href":"https://api.github.com/repos/loki-project/loki/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/loki-project/loki/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/loki-project/loki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/loki-project/loki/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/loki-project/loki/statuses/1e90128a1dd13fa59ca4c2f2d5c9d764189eb0c9"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sachaaaaa"}}