{"action":"created","comment":{"url":"https://api.github.com/repos/dashpay/dash/pulls/comments/132929247","pull_request_review_id":56054911,"id":132929247,"diff_hunk":"@@ -0,0 +1,75 @@\n+// Copyright (c) 2014-2017 The Dash Core developers\n+// Distributed under the MIT/X11 software license, see the accompanying\n+// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n+#include \"privatesend-util.h\"\n+\n+KeyHolder::KeyHolder(CWallet* pwallet)\n+        :reserveKey(pwallet)\n+{\n+        reserveKey.GetReservedKey(pubKey, false);\n+}\n+\n+void KeyHolder::KeepKey()\n+{\n+    reserveKey.KeepKey();\n+}\n+\n+void KeyHolder::ReturnKey()\n+{\n+    reserveKey.ReturnKey();\n+}\n+\n+CScript KeyHolder::GetScriptForDestination()\n+{\n+    return ::GetScriptForDestination(pubKey.GetID());\n+}\n+\n+\n+KeyHolderPtr KeyHolderStorage::AddKey(CWallet* pwallet)\n+{\n+    LogPrintf(\"PrivateSend - KeyHolderStorage -- AddKey\\n\");\n+    auto key = std::make_shared<KeyHolder>(pwallet);\n+    storage.push_back(key);\n+    return key;\n+}\n+\n+void KeyHolderStorage::KeepAll(){\n+    for(auto key : storage) {\n+        key->KeepKey();\n+    }\n+    storage.clear();\n+}\n+\n+void KeyHolderStorage::ReturnAll()\n+{\n+    for(auto key : storage) {\n+        key->ReturnKey();\n+    }\n+    storage.clear();\n+}\n+\n+void KeyHolderStorage::ClearOnFailure()","path":"src/privatesend-util.cpp","position":51,"original_position":51,"commit_id":"3c85892a53baab8623863170a8d065657c3010ca","original_commit_id":"3c85892a53baab8623863170a8d065657c3010ca","user":{"login":"krychlicki","id":26845331,"avatar_url":"https://avatars3.githubusercontent.com/u/26845331?v=4","gravatar_id":"","url":"https://api.github.com/users/krychlicki","html_url":"https://github.com/krychlicki","followers_url":"https://api.github.com/users/krychlicki/followers","following_url":"https://api.github.com/users/krychlicki/following{/other_user}","gists_url":"https://api.github.com/users/krychlicki/gists{/gist_id}","starred_url":"https://api.github.com/users/krychlicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krychlicki/subscriptions","organizations_url":"https://api.github.com/users/krychlicki/orgs","repos_url":"https://api.github.com/users/krychlicki/repos","events_url":"https://api.github.com/users/krychlicki/events{/privacy}","received_events_url":"https://api.github.com/users/krychlicki/received_events","type":"User","site_admin":false},"body":"My intention for ClearOn... methods was creating more verbose and easy to use interface. From your comments looks like it resulted in something quite the opposite. Will change it so there are only KeepAll and ReturnAll methods.","created_at":"2017-08-14T11:32:16Z","updated_at":"2017-08-14T11:32:16Z","html_url":"https://github.com/dashpay/dash/pull/1567#discussion_r132929247","pull_request_url":"https://api.github.com/repos/dashpay/dash/pulls/1567","_links":{"self":{"href":"https://api.github.com/repos/dashpay/dash/pulls/comments/132929247"},"html":{"href":"https://github.com/dashpay/dash/pull/1567#discussion_r132929247"},"pull_request":{"href":"https://api.github.com/repos/dashpay/dash/pulls/1567"}}},"pull_request":{"url":"https://api.github.com/repos/dashpay/dash/pulls/1567","id":134770576,"html_url":"https://github.com/dashpay/dash/pull/1567","diff_url":"https://github.com/dashpay/dash/pull/1567.diff","patch_url":"https://github.com/dashpay/dash/pull/1567.patch","issue_url":"https://api.github.com/repos/dashpay/dash/issues/1567","number":1567,"state":"open","locked":false,"title":"Fix losing keys on PrivateSend","user":{"login":"krychlicki","id":26845331,"avatar_url":"https://avatars3.githubusercontent.com/u/26845331?v=4","gravatar_id":"","url":"https://api.github.com/users/krychlicki","html_url":"https://github.com/krychlicki","followers_url":"https://api.github.com/users/krychlicki/followers","following_url":"https://api.github.com/users/krychlicki/following{/other_user}","gists_url":"https://api.github.com/users/krychlicki/gists{/gist_id}","starred_url":"https://api.github.com/users/krychlicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krychlicki/subscriptions","organizations_url":"https://api.github.com/users/krychlicki/orgs","repos_url":"https://api.github.com/users/krychlicki/repos","events_url":"https://api.github.com/users/krychlicki/events{/privacy}","received_events_url":"https://api.github.com/users/krychlicki/received_events","type":"User","site_admin":false},"body":"PrivateSend has been losing keys in following situations:\r\n1) One key gets lost during creation of denominations\r\n2) After mixing failure all keys used for outTX get lost\r\n\r\nUnfortunately, this change doesn't fix all the cases when PrivateSend is still losing keys (Datails were described in trac 33).\r\nHowever, with this change PrivateSend losses key much less frequently.","created_at":"2017-08-08T22:13:51Z","updated_at":"2017-08-14T11:32:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c70878ed960fb075b0d9e29a94e503c320ba6a9f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/dashpay/dash/milestones/3","html_url":"https://github.com/dashpay/dash/milestone/3","labels_url":"https://api.github.com/repos/dashpay/dash/milestones/3/labels","id":2249697,"number":3,"title":"12.2","description":null,"creator":{"login":"schinzelh","id":636669,"avatar_url":"https://avatars0.githubusercontent.com/u/636669?v=4","gravatar_id":"","url":"https://api.github.com/users/schinzelh","html_url":"https://github.com/schinzelh","followers_url":"https://api.github.com/users/schinzelh/followers","following_url":"https://api.github.com/users/schinzelh/following{/other_user}","gists_url":"https://api.github.com/users/schinzelh/gists{/gist_id}","starred_url":"https://api.github.com/users/schinzelh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schinzelh/subscriptions","organizations_url":"https://api.github.com/users/schinzelh/orgs","repos_url":"https://api.github.com/users/schinzelh/repos","events_url":"https://api.github.com/users/schinzelh/events{/privacy}","received_events_url":"https://api.github.com/users/schinzelh/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":111,"state":"open","created_at":"2017-01-13T11:50:01Z","updated_at":"2017-08-11T18:52:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dashpay/dash/pulls/1567/commits","review_comments_url":"https://api.github.com/repos/dashpay/dash/pulls/1567/comments","review_comment_url":"https://api.github.com/repos/dashpay/dash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dashpay/dash/issues/1567/comments","statuses_url":"https://api.github.com/repos/dashpay/dash/statuses/3c85892a53baab8623863170a8d065657c3010ca","head":{"label":"krychlicki:track_33","ref":"track_33","sha":"3c85892a53baab8623863170a8d065657c3010ca","user":{"login":"krychlicki","id":26845331,"avatar_url":"https://avatars3.githubusercontent.com/u/26845331?v=4","gravatar_id":"","url":"https://api.github.com/users/krychlicki","html_url":"https://github.com/krychlicki","followers_url":"https://api.github.com/users/krychlicki/followers","following_url":"https://api.github.com/users/krychlicki/following{/other_user}","gists_url":"https://api.github.com/users/krychlicki/gists{/gist_id}","starred_url":"https://api.github.com/users/krychlicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krychlicki/subscriptions","organizations_url":"https://api.github.com/users/krychlicki/orgs","repos_url":"https://api.github.com/users/krychlicki/repos","events_url":"https://api.github.com/users/krychlicki/events{/privacy}","received_events_url":"https://api.github.com/users/krychlicki/received_events","type":"User","site_admin":false},"repo":{"id":86990852,"name":"dash","full_name":"krychlicki/dash","owner":{"login":"krychlicki","id":26845331,"avatar_url":"https://avatars3.githubusercontent.com/u/26845331?v=4","gravatar_id":"","url":"https://api.github.com/users/krychlicki","html_url":"https://github.com/krychlicki","followers_url":"https://api.github.com/users/krychlicki/followers","following_url":"https://api.github.com/users/krychlicki/following{/other_user}","gists_url":"https://api.github.com/users/krychlicki/gists{/gist_id}","starred_url":"https://api.github.com/users/krychlicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krychlicki/subscriptions","organizations_url":"https://api.github.com/users/krychlicki/orgs","repos_url":"https://api.github.com/users/krychlicki/repos","events_url":"https://api.github.com/users/krychlicki/events{/privacy}","received_events_url":"https://api.github.com/users/krychlicki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krychlicki/dash","description":"Dash - Reinventing Cryptocurrency","fork":true,"url":"https://api.github.com/repos/krychlicki/dash","forks_url":"https://api.github.com/repos/krychlicki/dash/forks","keys_url":"https://api.github.com/repos/krychlicki/dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krychlicki/dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krychlicki/dash/teams","hooks_url":"https://api.github.com/repos/krychlicki/dash/hooks","issue_events_url":"https://api.github.com/repos/krychlicki/dash/issues/events{/number}","events_url":"https://api.github.com/repos/krychlicki/dash/events","assignees_url":"https://api.github.com/repos/krychlicki/dash/assignees{/user}","branches_url":"https://api.github.com/repos/krychlicki/dash/branches{/branch}","tags_url":"https://api.github.com/repos/krychlicki/dash/tags","blobs_url":"https://api.github.com/repos/krychlicki/dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krychlicki/dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krychlicki/dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/krychlicki/dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krychlicki/dash/statuses/{sha}","languages_url":"https://api.github.com/repos/krychlicki/dash/languages","stargazers_url":"https://api.github.com/repos/krychlicki/dash/stargazers","contributors_url":"https://api.github.com/repos/krychlicki/dash/contributors","subscribers_url":"https://api.github.com/repos/krychlicki/dash/subscribers","subscription_url":"https://api.github.com/repos/krychlicki/dash/subscription","commits_url":"https://api.github.com/repos/krychlicki/dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/krychlicki/dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/krychlicki/dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/krychlicki/dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/krychlicki/dash/contents/{+path}","compare_url":"https://api.github.com/repos/krychlicki/dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krychlicki/dash/merges","archive_url":"https://api.github.com/repos/krychlicki/dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krychlicki/dash/downloads","issues_url":"https://api.github.com/repos/krychlicki/dash/issues{/number}","pulls_url":"https://api.github.com/repos/krychlicki/dash/pulls{/number}","milestones_url":"https://api.github.com/repos/krychlicki/dash/milestones{/number}","notifications_url":"https://api.github.com/repos/krychlicki/dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krychlicki/dash/labels{/name}","releases_url":"https://api.github.com/repos/krychlicki/dash/releases{/id}","deployments_url":"https://api.github.com/repos/krychlicki/dash/deployments","created_at":"2017-04-02T14:16:36Z","updated_at":"2017-04-02T14:16:51Z","pushed_at":"2017-08-08T21:38:54Z","git_url":"git://github.com/krychlicki/dash.git","ssh_url":"git@github.com:krychlicki/dash.git","clone_url":"https://github.com/krychlicki/dash.git","svn_url":"https://github.com/krychlicki/dash","homepage":"https://www.dash.org","size":104062,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"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":"dashpay:v0.12.2.x","ref":"v0.12.2.x","sha":"bcf5455bfdfd64e1de46625da9fba456c0875dfd","user":{"login":"dashpay","id":11511719,"avatar_url":"https://avatars0.githubusercontent.com/u/11511719?v=4","gravatar_id":"","url":"https://api.github.com/users/dashpay","html_url":"https://github.com/dashpay","followers_url":"https://api.github.com/users/dashpay/followers","following_url":"https://api.github.com/users/dashpay/following{/other_user}","gists_url":"https://api.github.com/users/dashpay/gists{/gist_id}","starred_url":"https://api.github.com/users/dashpay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dashpay/subscriptions","organizations_url":"https://api.github.com/users/dashpay/orgs","repos_url":"https://api.github.com/users/dashpay/repos","events_url":"https://api.github.com/users/dashpay/events{/privacy}","received_events_url":"https://api.github.com/users/dashpay/received_events","type":"Organization","site_admin":false},"repo":{"id":19352450,"name":"dash","full_name":"dashpay/dash","owner":{"login":"dashpay","id":11511719,"avatar_url":"https://avatars0.githubusercontent.com/u/11511719?v=4","gravatar_id":"","url":"https://api.github.com/users/dashpay","html_url":"https://github.com/dashpay","followers_url":"https://api.github.com/users/dashpay/followers","following_url":"https://api.github.com/users/dashpay/following{/other_user}","gists_url":"https://api.github.com/users/dashpay/gists{/gist_id}","starred_url":"https://api.github.com/users/dashpay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dashpay/subscriptions","organizations_url":"https://api.github.com/users/dashpay/orgs","repos_url":"https://api.github.com/users/dashpay/repos","events_url":"https://api.github.com/users/dashpay/events{/privacy}","received_events_url":"https://api.github.com/users/dashpay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dashpay/dash","description":"Dash - Reinventing Cryptocurrency","fork":true,"url":"https://api.github.com/repos/dashpay/dash","forks_url":"https://api.github.com/repos/dashpay/dash/forks","keys_url":"https://api.github.com/repos/dashpay/dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dashpay/dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dashpay/dash/teams","hooks_url":"https://api.github.com/repos/dashpay/dash/hooks","issue_events_url":"https://api.github.com/repos/dashpay/dash/issues/events{/number}","events_url":"https://api.github.com/repos/dashpay/dash/events","assignees_url":"https://api.github.com/repos/dashpay/dash/assignees{/user}","branches_url":"https://api.github.com/repos/dashpay/dash/branches{/branch}","tags_url":"https://api.github.com/repos/dashpay/dash/tags","blobs_url":"https://api.github.com/repos/dashpay/dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dashpay/dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dashpay/dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/dashpay/dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dashpay/dash/statuses/{sha}","languages_url":"https://api.github.com/repos/dashpay/dash/languages","stargazers_url":"https://api.github.com/repos/dashpay/dash/stargazers","contributors_url":"https://api.github.com/repos/dashpay/dash/contributors","subscribers_url":"https://api.github.com/repos/dashpay/dash/subscribers","subscription_url":"https://api.github.com/repos/dashpay/dash/subscription","commits_url":"https://api.github.com/repos/dashpay/dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/dashpay/dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/dashpay/dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/dashpay/dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/dashpay/dash/contents/{+path}","compare_url":"https://api.github.com/repos/dashpay/dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dashpay/dash/merges","archive_url":"https://api.github.com/repos/dashpay/dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dashpay/dash/downloads","issues_url":"https://api.github.com/repos/dashpay/dash/issues{/number}","pulls_url":"https://api.github.com/repos/dashpay/dash/pulls{/number}","milestones_url":"https://api.github.com/repos/dashpay/dash/milestones{/number}","notifications_url":"https://api.github.com/repos/dashpay/dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dashpay/dash/labels{/name}","releases_url":"https://api.github.com/repos/dashpay/dash/releases{/id}","deployments_url":"https://api.github.com/repos/dashpay/dash/deployments","created_at":"2014-05-01T17:45:34Z","updated_at":"2017-08-14T09:21:49Z","pushed_at":"2017-08-11T18:52:07Z","git_url":"git://github.com/dashpay/dash.git","ssh_url":"git@github.com:dashpay/dash.git","clone_url":"https://github.com/dashpay/dash.git","svn_url":"https://github.com/dashpay/dash","homepage":"https://www.dash.org","size":105121,"stargazers_count":518,"watchers_count":518,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"open_issues_count":73,"forks":314,"open_issues":73,"watchers":518,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dashpay/dash/pulls/1567"},"html":{"href":"https://github.com/dashpay/dash/pull/1567"},"issue":{"href":"https://api.github.com/repos/dashpay/dash/issues/1567"},"comments":{"href":"https://api.github.com/repos/dashpay/dash/issues/1567/comments"},"review_comments":{"href":"https://api.github.com/repos/dashpay/dash/pulls/1567/comments"},"review_comment":{"href":"https://api.github.com/repos/dashpay/dash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dashpay/dash/pulls/1567/commits"},"statuses":{"href":"https://api.github.com/repos/dashpay/dash/statuses/3c85892a53baab8623863170a8d065657c3010ca"}}}}
{"actor":{"display_login":"krychlicki"}}