{"action":"created","comment":{"url":"https://api.github.com/repos/conformal/btcwallet/pulls/comments/22807079","id":22807079,"diff_hunk":"@@ -2008,13 +2095,24 @@ func GetTransaction(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interf\n func ListAccounts(w *Wallet, chainSvr *chain.Client, icmd btcjson.Cmd) (interface{}, error) {\n \tcmd := icmd.(*btcjson.ListAccountsCmd)\n \n-\tbal, err := w.CalculateBalance(cmd.MinConf)\n+\taccountBalances := map[string]float64{}\n+\taccounts, err := w.Manager.AllAccounts()\n \tif err != nil {\n \t\treturn nil, err\n \t}\n-\n+\tfor _, account := range accounts {\n+\t\tacctName, err := w.Manager.AccountName(account)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\tbal, err := w.CalculateAccountBalance(account, cmd.MinConf)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\taccountBalances[acctName] = bal.ToUnit(btcutil.AmountBTC)","path":"rpcserver.go","position":607,"original_position":607,"commit_id":"66e311bd8ef1e1f26e8cee611a4ed6439a467c04","original_commit_id":"677faaf379225988e9235818aa20b8ff98ded0a3","user":{"login":"jrick","id":1420313,"avatar_url":"https://avatars.githubusercontent.com/u/1420313?v=3","gravatar_id":"","url":"https://api.github.com/users/jrick","html_url":"https://github.com/jrick","followers_url":"https://api.github.com/users/jrick/followers","following_url":"https://api.github.com/users/jrick/following{/other_user}","gists_url":"https://api.github.com/users/jrick/gists{/gist_id}","starred_url":"https://api.github.com/users/jrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrick/subscriptions","organizations_url":"https://api.github.com/users/jrick/orgs","repos_url":"https://api.github.com/users/jrick/repos","events_url":"https://api.github.com/users/jrick/events{/privacy}","received_events_url":"https://api.github.com/users/jrick/received_events","type":"User","site_admin":false},"body":"You can use the new Amount.ToBTC method here (perhaps a good idea to just search and replace it everywhere).","created_at":"2015-01-12T17:49:50Z","updated_at":"2015-01-12T17:49:50Z","html_url":"https://github.com/conformal/btcwallet/pull/155#discussion_r22807079","pull_request_url":"https://api.github.com/repos/conformal/btcwallet/pulls/155","_links":{"self":{"href":"https://api.github.com/repos/conformal/btcwallet/pulls/comments/22807079"},"html":{"href":"https://github.com/conformal/btcwallet/pull/155#discussion_r22807079"},"pull_request":{"href":"https://api.github.com/repos/conformal/btcwallet/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/conformal/btcwallet/pulls/155","id":26211709,"html_url":"https://github.com/conformal/btcwallet/pull/155","diff_url":"https://github.com/conformal/btcwallet/pull/155.diff","patch_url":"https://github.com/conformal/btcwallet/pull/155.patch","issue_url":"https://api.github.com/repos/conformal/btcwallet/issues/155","number":155,"state":"open","locked":false,"title":"Account name","user":{"login":"tuxcanfly","id":132667,"avatar_url":"https://avatars.githubusercontent.com/u/132667?v=3","gravatar_id":"","url":"https://api.github.com/users/tuxcanfly","html_url":"https://github.com/tuxcanfly","followers_url":"https://api.github.com/users/tuxcanfly/followers","following_url":"https://api.github.com/users/tuxcanfly/following{/other_user}","gists_url":"https://api.github.com/users/tuxcanfly/gists{/gist_id}","starred_url":"https://api.github.com/users/tuxcanfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuxcanfly/subscriptions","organizations_url":"https://api.github.com/users/tuxcanfly/orgs","repos_url":"https://api.github.com/users/tuxcanfly/repos","events_url":"https://api.github.com/users/tuxcanfly/events{/privacy}","received_events_url":"https://api.github.com/users/tuxcanfly/received_events","type":"User","site_admin":false},"body":"**NOTE: This pull request requires #147**\r\n\r\nUpdated `waddrmgr` to support account names and integrated with wallet RPC calls.","created_at":"2014-12-17T09:51:32Z","updated_at":"2015-01-12T17:49:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a392553e247cb901eaa8ae4154c8912e0298aa3b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/conformal/btcwallet/pulls/155/commits","review_comments_url":"https://api.github.com/repos/conformal/btcwallet/pulls/155/comments","review_comment_url":"https://api.github.com/repos/conformal/btcwallet/pulls/comments/{number}","comments_url":"https://api.github.com/repos/conformal/btcwallet/issues/155/comments","statuses_url":"https://api.github.com/repos/conformal/btcwallet/statuses/66e311bd8ef1e1f26e8cee611a4ed6439a467c04","head":{"label":"tuxcanfly:account-name","ref":"account-name","sha":"66e311bd8ef1e1f26e8cee611a4ed6439a467c04","user":{"login":"tuxcanfly","id":132667,"avatar_url":"https://avatars.githubusercontent.com/u/132667?v=3","gravatar_id":"","url":"https://api.github.com/users/tuxcanfly","html_url":"https://github.com/tuxcanfly","followers_url":"https://api.github.com/users/tuxcanfly/followers","following_url":"https://api.github.com/users/tuxcanfly/following{/other_user}","gists_url":"https://api.github.com/users/tuxcanfly/gists{/gist_id}","starred_url":"https://api.github.com/users/tuxcanfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuxcanfly/subscriptions","organizations_url":"https://api.github.com/users/tuxcanfly/orgs","repos_url":"https://api.github.com/users/tuxcanfly/repos","events_url":"https://api.github.com/users/tuxcanfly/events{/privacy}","received_events_url":"https://api.github.com/users/tuxcanfly/received_events","type":"User","site_admin":false},"repo":{"id":21453162,"name":"btcwallet","full_name":"tuxcanfly/btcwallet","owner":{"login":"tuxcanfly","id":132667,"avatar_url":"https://avatars.githubusercontent.com/u/132667?v=3","gravatar_id":"","url":"https://api.github.com/users/tuxcanfly","html_url":"https://github.com/tuxcanfly","followers_url":"https://api.github.com/users/tuxcanfly/followers","following_url":"https://api.github.com/users/tuxcanfly/following{/other_user}","gists_url":"https://api.github.com/users/tuxcanfly/gists{/gist_id}","starred_url":"https://api.github.com/users/tuxcanfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuxcanfly/subscriptions","organizations_url":"https://api.github.com/users/tuxcanfly/orgs","repos_url":"https://api.github.com/users/tuxcanfly/repos","events_url":"https://api.github.com/users/tuxcanfly/events{/privacy}","received_events_url":"https://api.github.com/users/tuxcanfly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tuxcanfly/btcwallet","description":"","fork":true,"url":"https://api.github.com/repos/tuxcanfly/btcwallet","forks_url":"https://api.github.com/repos/tuxcanfly/btcwallet/forks","keys_url":"https://api.github.com/repos/tuxcanfly/btcwallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tuxcanfly/btcwallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tuxcanfly/btcwallet/teams","hooks_url":"https://api.github.com/repos/tuxcanfly/btcwallet/hooks","issue_events_url":"https://api.github.com/repos/tuxcanfly/btcwallet/issues/events{/number}","events_url":"https://api.github.com/repos/tuxcanfly/btcwallet/events","assignees_url":"https://api.github.com/repos/tuxcanfly/btcwallet/assignees{/user}","branches_url":"https://api.github.com/repos/tuxcanfly/btcwallet/branches{/branch}","tags_url":"https://api.github.com/repos/tuxcanfly/btcwallet/tags","blobs_url":"https://api.github.com/repos/tuxcanfly/btcwallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tuxcanfly/btcwallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tuxcanfly/btcwallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/tuxcanfly/btcwallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tuxcanfly/btcwallet/statuses/{sha}","languages_url":"https://api.github.com/repos/tuxcanfly/btcwallet/languages","stargazers_url":"https://api.github.com/repos/tuxcanfly/btcwallet/stargazers","contributors_url":"https://api.github.com/repos/tuxcanfly/btcwallet/contributors","subscribers_url":"https://api.github.com/repos/tuxcanfly/btcwallet/subscribers","subscription_url":"https://api.github.com/repos/tuxcanfly/btcwallet/subscription","commits_url":"https://api.github.com/repos/tuxcanfly/btcwallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/tuxcanfly/btcwallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/tuxcanfly/btcwallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/tuxcanfly/btcwallet/issues/comments/{number}","contents_url":"https://api.github.com/repos/tuxcanfly/btcwallet/contents/{+path}","compare_url":"https://api.github.com/repos/tuxcanfly/btcwallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tuxcanfly/btcwallet/merges","archive_url":"https://api.github.com/repos/tuxcanfly/btcwallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tuxcanfly/btcwallet/downloads","issues_url":"https://api.github.com/repos/tuxcanfly/btcwallet/issues{/number}","pulls_url":"https://api.github.com/repos/tuxcanfly/btcwallet/pulls{/number}","milestones_url":"https://api.github.com/repos/tuxcanfly/btcwallet/milestones{/number}","notifications_url":"https://api.github.com/repos/tuxcanfly/btcwallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tuxcanfly/btcwallet/labels{/name}","releases_url":"https://api.github.com/repos/tuxcanfly/btcwallet/releases{/id}","created_at":"2014-07-03T07:10:43Z","updated_at":"2014-07-09T11:38:45Z","pushed_at":"2015-01-12T17:44:43Z","git_url":"git://github.com/tuxcanfly/btcwallet.git","ssh_url":"git@github.com:tuxcanfly/btcwallet.git","clone_url":"https://github.com/tuxcanfly/btcwallet.git","svn_url":"https://github.com/tuxcanfly/btcwallet","homepage":null,"size":2963,"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":"conformal:master","ref":"master","sha":"edaddb0d95d9313f21d9a4bb40bc6232b87c0361","user":{"login":"conformal","id":1123608,"avatar_url":"https://avatars.githubusercontent.com/u/1123608?v=3","gravatar_id":"","url":"https://api.github.com/users/conformal","html_url":"https://github.com/conformal","followers_url":"https://api.github.com/users/conformal/followers","following_url":"https://api.github.com/users/conformal/following{/other_user}","gists_url":"https://api.github.com/users/conformal/gists{/gist_id}","starred_url":"https://api.github.com/users/conformal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conformal/subscriptions","organizations_url":"https://api.github.com/users/conformal/orgs","repos_url":"https://api.github.com/users/conformal/repos","events_url":"https://api.github.com/users/conformal/events{/privacy}","received_events_url":"https://api.github.com/users/conformal/received_events","type":"Organization","site_admin":false},"repo":{"id":12136863,"name":"btcwallet","full_name":"conformal/btcwallet","owner":{"login":"conformal","id":1123608,"avatar_url":"https://avatars.githubusercontent.com/u/1123608?v=3","gravatar_id":"","url":"https://api.github.com/users/conformal","html_url":"https://github.com/conformal","followers_url":"https://api.github.com/users/conformal/followers","following_url":"https://api.github.com/users/conformal/following{/other_user}","gists_url":"https://api.github.com/users/conformal/gists{/gist_id}","starred_url":"https://api.github.com/users/conformal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conformal/subscriptions","organizations_url":"https://api.github.com/users/conformal/orgs","repos_url":"https://api.github.com/users/conformal/repos","events_url":"https://api.github.com/users/conformal/events{/privacy}","received_events_url":"https://api.github.com/users/conformal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conformal/btcwallet","description":"","fork":false,"url":"https://api.github.com/repos/conformal/btcwallet","forks_url":"https://api.github.com/repos/conformal/btcwallet/forks","keys_url":"https://api.github.com/repos/conformal/btcwallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conformal/btcwallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conformal/btcwallet/teams","hooks_url":"https://api.github.com/repos/conformal/btcwallet/hooks","issue_events_url":"https://api.github.com/repos/conformal/btcwallet/issues/events{/number}","events_url":"https://api.github.com/repos/conformal/btcwallet/events","assignees_url":"https://api.github.com/repos/conformal/btcwallet/assignees{/user}","branches_url":"https://api.github.com/repos/conformal/btcwallet/branches{/branch}","tags_url":"https://api.github.com/repos/conformal/btcwallet/tags","blobs_url":"https://api.github.com/repos/conformal/btcwallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conformal/btcwallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conformal/btcwallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/conformal/btcwallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conformal/btcwallet/statuses/{sha}","languages_url":"https://api.github.com/repos/conformal/btcwallet/languages","stargazers_url":"https://api.github.com/repos/conformal/btcwallet/stargazers","contributors_url":"https://api.github.com/repos/conformal/btcwallet/contributors","subscribers_url":"https://api.github.com/repos/conformal/btcwallet/subscribers","subscription_url":"https://api.github.com/repos/conformal/btcwallet/subscription","commits_url":"https://api.github.com/repos/conformal/btcwallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/conformal/btcwallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/conformal/btcwallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/conformal/btcwallet/issues/comments/{number}","contents_url":"https://api.github.com/repos/conformal/btcwallet/contents/{+path}","compare_url":"https://api.github.com/repos/conformal/btcwallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conformal/btcwallet/merges","archive_url":"https://api.github.com/repos/conformal/btcwallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conformal/btcwallet/downloads","issues_url":"https://api.github.com/repos/conformal/btcwallet/issues{/number}","pulls_url":"https://api.github.com/repos/conformal/btcwallet/pulls{/number}","milestones_url":"https://api.github.com/repos/conformal/btcwallet/milestones{/number}","notifications_url":"https://api.github.com/repos/conformal/btcwallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conformal/btcwallet/labels{/name}","releases_url":"https://api.github.com/repos/conformal/btcwallet/releases{/id}","created_at":"2013-08-15T14:53:57Z","updated_at":"2015-01-09T16:46:35Z","pushed_at":"2015-01-09T16:46:35Z","git_url":"git://github.com/conformal/btcwallet.git","ssh_url":"git@github.com:conformal/btcwallet.git","clone_url":"https://github.com/conformal/btcwallet.git","svn_url":"https://github.com/conformal/btcwallet","homepage":null,"size":4651,"stargazers_count":58,"watchers_count":58,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":25,"forks":27,"open_issues":25,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/conformal/btcwallet/pulls/155"},"html":{"href":"https://github.com/conformal/btcwallet/pull/155"},"issue":{"href":"https://api.github.com/repos/conformal/btcwallet/issues/155"},"comments":{"href":"https://api.github.com/repos/conformal/btcwallet/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/conformal/btcwallet/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/conformal/btcwallet/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/conformal/btcwallet/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/conformal/btcwallet/statuses/66e311bd8ef1e1f26e8cee611a4ed6439a467c04"}}}}