{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/229092060","pull_request_review_id":169507469,"id":229092060,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTA5MjA2MA==","diff_hunk":"@@ -709,9 +709,18 @@ static UniValue getbalance(const JSONRPCRequest& request)\n \n     LOCK2(cs_main, pwallet->cs_wallet);\n \n-    const UniValue& dummy_value = request.params[0];\n-    if (!dummy_value.isNull() && dummy_value.get_str() != \"*\") {\n-        throw JSONRPCError(RPC_METHOD_DEPRECATED, \"dummy first argument must be excluded or set to \\\"*\\\".\");\n+    const UniValue& trusted_only_uv = request.params[0];\n+    bool trusted_only = true;\n+    if (trusted_only_uv.isBool()) {\n+        trusted_only = trusted_only_uv.get_bool();\n+    } else if (trusted_only_uv.isStr()) {\n+        // backward compatibility\n+        if (trusted_only_uv.get_str() != \"*\") {","path":"src/wallet/rpcwallet.cpp","position":28,"original_position":28,"commit_id":"5505437e8b09c4d51c65a84968e73baee51f29ab","original_commit_id":"5505437e8b09c4d51c65a84968e73baee51f29ab","user":{"login":"jnewbery","id":1063656,"node_id":"MDQ6VXNlcjEwNjM2NTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1063656?v=4","gravatar_id":"","url":"https://api.github.com/users/jnewbery","html_url":"https://github.com/jnewbery","followers_url":"https://api.github.com/users/jnewbery/followers","following_url":"https://api.github.com/users/jnewbery/following{/other_user}","gists_url":"https://api.github.com/users/jnewbery/gists{/gist_id}","starred_url":"https://api.github.com/users/jnewbery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnewbery/subscriptions","organizations_url":"https://api.github.com/users/jnewbery/orgs","repos_url":"https://api.github.com/users/jnewbery/repos","events_url":"https://api.github.com/users/jnewbery/events{/privacy}","received_events_url":"https://api.github.com/users/jnewbery/received_events","type":"User","site_admin":false},"body":"I'd prefer to drop this undocumented functionality if at all possible. It's confusing that `getbalance` and `getbalance *` should return different values (and this argument has been deprecated since https://github.com/bitcoin/bitcoin/commit/7b782f5b01f4c2d906a28800d01ffd05ad257cbe).","created_at":"2018-10-29T20:46:15Z","updated_at":"2018-10-29T20:47:40Z","html_url":"https://github.com/bitcoin/bitcoin/pull/14602#discussion_r229092060","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/229092060"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/14602#discussion_r229092060"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602","id":226619249,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NjE5MjQ5","html_url":"https://github.com/bitcoin/bitcoin/pull/14602","diff_url":"https://github.com/bitcoin/bitcoin/pull/14602.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/14602.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14602","number":14602,"state":"open","locked":false,"title":"Bugfix: Correctly calculate balances when min_conf is used, and for getbalance(\"*\")","user":{"login":"luke-jr","id":1095675,"node_id":"MDQ6VXNlcjEwOTU2NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"body":"`getbalance(\"*\")` has always given the final balance ignoring whether the wallet considers coins trusted or not, while `getbalance()` checked the trusted status.\r\n\r\nFurthermore, `CWallet::GetBalance` (the trusted-only implementation) did not support setting a `min_conf` parameter. This was added in #13566, but only checked `min_conf` for UTXO creation, not UTXO spending.\r\n\r\nThis fixes `getbalance` to work correctly in both regards.\r\n\r\nIt also renames the dummy argument to `trusted_only` and accepts a boolean instead of the fixed string `\"*\"` to fit more with the no-accounts stuff.\r\n\r\nSee also: #6276 fixed the first issue in 2015.\r\n","created_at":"2018-10-29T16:04:27Z","updated_at":"2018-10-29T20:47:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e3ed341134f5d359cbded5e47a89018cca365fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":98279177,"node_id":"MDU6TGFiZWw5ODI3OTE3Nw==","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/RPC/REST/ZMQ","name":"RPC/REST/ZMQ","color":"0052cc","default":false},{"id":149424,"node_id":"MDU6TGFiZWwxNDk0MjQ=","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Wallet","name":"Wallet","color":"08a781","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/14602/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/5505437e8b09c4d51c65a84968e73baee51f29ab","head":{"label":"luke-jr:bugfix_rpc_getbalance_untrusted","ref":"bugfix_rpc_getbalance_untrusted","sha":"5505437e8b09c4d51c65a84968e73baee51f29ab","user":{"login":"luke-jr","id":1095675,"node_id":"MDQ6VXNlcjEwOTU2NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"repo":{"id":2514537,"node_id":"MDEwOlJlcG9zaXRvcnkyNTE0NTM3","name":"bitcoin","full_name":"luke-jr/bitcoin","private":false,"owner":{"login":"luke-jr","id":1095675,"node_id":"MDQ6VXNlcjEwOTU2NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/luke-jr/bitcoin","description":"Bitcoin integration/staging tree","fork":true,"url":"https://api.github.com/repos/luke-jr/bitcoin","forks_url":"https://api.github.com/repos/luke-jr/bitcoin/forks","keys_url":"https://api.github.com/repos/luke-jr/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luke-jr/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luke-jr/bitcoin/teams","hooks_url":"https://api.github.com/repos/luke-jr/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/luke-jr/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/luke-jr/bitcoin/events","assignees_url":"https://api.github.com/repos/luke-jr/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/luke-jr/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/luke-jr/bitcoin/tags","blobs_url":"https://api.github.com/repos/luke-jr/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luke-jr/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luke-jr/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/luke-jr/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luke-jr/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/luke-jr/bitcoin/languages","stargazers_url":"https://api.github.com/repos/luke-jr/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/luke-jr/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/luke-jr/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/luke-jr/bitcoin/subscription","commits_url":"https://api.github.com/repos/luke-jr/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/luke-jr/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/luke-jr/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/luke-jr/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/luke-jr/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/luke-jr/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luke-jr/bitcoin/merges","archive_url":"https://api.github.com/repos/luke-jr/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luke-jr/bitcoin/downloads","issues_url":"https://api.github.com/repos/luke-jr/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/luke-jr/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/luke-jr/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/luke-jr/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luke-jr/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/luke-jr/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/luke-jr/bitcoin/deployments","created_at":"2011-10-04T20:22:23Z","updated_at":"2018-08-21T18:58:36Z","pushed_at":"2018-10-29T20:40:24Z","git_url":"git://github.com/luke-jr/bitcoin.git","ssh_url":"git@github.com:luke-jr/bitcoin.git","clone_url":"https://github.com/luke-jr/bitcoin.git","svn_url":"https://github.com/luke-jr/bitcoin","homepage":"","size":129968,"stargazers_count":15,"watchers_count":15,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":0,"watchers":15,"default_branch":"0.11.x-ljrP"}},"base":{"label":"bitcoin:master","ref":"master","sha":"29f429dc7d4c7e6cd012e749cadf89e3138bcab3","user":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgxOTI3","name":"bitcoin","full_name":"bitcoin/bitcoin","private":false,"owner":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2018-10-29T16:36:44Z","pushed_at":"2018-10-29T20:21:32Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoincore.org/en/download","size":114851,"stargazers_count":35657,"watchers_count":35657,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":21539,"mirror_url":null,"archived":false,"open_issues_count":878,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":21539,"open_issues":878,"watchers":35657,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/14602"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/14602"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/14602/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/14602/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/5505437e8b09c4d51c65a84968e73baee51f29ab"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jnewbery"}}