{"action":"created","comment":{"url":"https://api.github.com/repos/decred/dcrwallet/pulls/comments/227473194","pull_request_review_id":167520999,"id":227473194,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzQ3MzE5NA==","diff_hunk":"@@ -2031,7 +2050,70 @@ func StartTicketBuyerService(server *grpc.Server, loader *loader.Loader, tbCfg *\n \t}\n }\n \n-func (t *ticketbuyerServer) checkReady() bool {\n+// StartTicketBuyer starts the automatic ticket buyer for the v2 service.\n+func (t *ticketbuyerV2Server) RunTicketBuyer(req *pb.RunTicketBuyerRequest, svr pb.TicketBuyerV2Service_RunTicketBuyerServer) error {\n+\n+\twallet, ok := t.loader.LoadedWallet()\n+\tif !ok {\n+\t\treturn status.Errorf(codes.FailedPrecondition, \"Wallet has not been loaded\")\n+\t}\n+\tparams := wallet.ChainParams()\n+\n+\t// Confirm validity of provided voting addresses and pool addresses.\n+\tvar votingAddress dcrutil.Address\n+\tvar err error\n+\tif req.VotingAddress != \"\" {\n+\t\tvotingAddress, err = decodeAddress(req.VotingAddress, params)\n+\t\tif err != nil {\n+\t\t\treturn status.Errorf(codes.FailedPrecondition, \"Invalid Voting Address\")\n+\t\t}\n+\t}\n+\tvar poolAddress dcrutil.Address\n+\tif req.PoolAddress != \"\" {\n+\t\tpoolAddress, err = decodeAddress(req.PoolAddress, params)\n+\t\tif err != nil {\n+\t\t\treturn status.Errorf(codes.FailedPrecondition, \"Invalid Pool Address\")\n+\t\t}\n+\t}\n+\n+\tif req.BalanceToMaintain < 0 {\n+\t\treturn status.Errorf(codes.InvalidArgument, \"Negative balance to maintain given\")\n+\t}\n+\n+\ttb := tbv2.New(wallet)\n+\n+\t// Set ticketbuyerV2 config\n+\ttb.AccessConfig(func(c *tbv2.Config) {\n+\t\tc.Account = req.Account\n+\t\tc.VotingAccount = req.VotingAccount // TODO: Make this a unique config option. Set to acct for compat with v1.","path":"rpc/rpcserver/server.go","position":113,"original_position":113,"commit_id":"86a93f842e43618d4d6698f72df49e11ec5da336","original_commit_id":"86a93f842e43618d4d6698f72df49e11ec5da336","user":{"login":"jrick","id":1420313,"node_id":"MDQ6VXNlcjE0MjAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1420313?v=4","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":"comment isn't necessary because it is addressed by this rpc argument.","created_at":"2018-10-23T16:37:40Z","updated_at":"2018-10-23T16:46:15Z","html_url":"https://github.com/decred/dcrwallet/pull/1307#discussion_r227473194","pull_request_url":"https://api.github.com/repos/decred/dcrwallet/pulls/1307","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/decred/dcrwallet/pulls/comments/227473194"},"html":{"href":"https://github.com/decred/dcrwallet/pull/1307#discussion_r227473194"},"pull_request":{"href":"https://api.github.com/repos/decred/dcrwallet/pulls/1307"}}},"pull_request":{"url":"https://api.github.com/repos/decred/dcrwallet/pulls/1307","id":224794069,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0Nzk0MDY5","html_url":"https://github.com/decred/dcrwallet/pull/1307","diff_url":"https://github.com/decred/dcrwallet/pull/1307.diff","patch_url":"https://github.com/decred/dcrwallet/pull/1307.patch","issue_url":"https://api.github.com/repos/decred/dcrwallet/issues/1307","number":1307,"state":"open","locked":false,"title":"rpc: Add StartTicketBuyer rpc for v2","user":{"login":"alexlyp","id":4388501,"node_id":"MDQ6VXNlcjQzODg1MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/4388501?v=4","gravatar_id":"","url":"https://api.github.com/users/alexlyp","html_url":"https://github.com/alexlyp","followers_url":"https://api.github.com/users/alexlyp/followers","following_url":"https://api.github.com/users/alexlyp/following{/other_user}","gists_url":"https://api.github.com/users/alexlyp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlyp/subscriptions","organizations_url":"https://api.github.com/users/alexlyp/orgs","repos_url":"https://api.github.com/users/alexlyp/repos","events_url":"https://api.github.com/users/alexlyp/events{/privacy}","received_events_url":"https://api.github.com/users/alexlyp/received_events","type":"User","site_admin":false},"body":"This commit adds the ability to start the ticketbuyer v2 that was\r\nrecently added.  This makes the process of starting and stopping the\r\nticketbuyer v2 much simpler than it's v1 counterpart.\r\n\r\nThis also will allow users to start multiple ticketbuyers per account\r\nif they would like.","created_at":"2018-10-22T19:54:55Z","updated_at":"2018-10-23T16:46:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6046030c3c13eaa02bf21f13b90124e4a1c7c9d5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/decred/dcrwallet/pulls/1307/commits","review_comments_url":"https://api.github.com/repos/decred/dcrwallet/pulls/1307/comments","review_comment_url":"https://api.github.com/repos/decred/dcrwallet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/decred/dcrwallet/issues/1307/comments","statuses_url":"https://api.github.com/repos/decred/dcrwallet/statuses/86a93f842e43618d4d6698f72df49e11ec5da336","head":{"label":"alexlyp:ayp_ticketbuyer","ref":"ayp_ticketbuyer","sha":"86a93f842e43618d4d6698f72df49e11ec5da336","user":{"login":"alexlyp","id":4388501,"node_id":"MDQ6VXNlcjQzODg1MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/4388501?v=4","gravatar_id":"","url":"https://api.github.com/users/alexlyp","html_url":"https://github.com/alexlyp","followers_url":"https://api.github.com/users/alexlyp/followers","following_url":"https://api.github.com/users/alexlyp/following{/other_user}","gists_url":"https://api.github.com/users/alexlyp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlyp/subscriptions","organizations_url":"https://api.github.com/users/alexlyp/orgs","repos_url":"https://api.github.com/users/alexlyp/repos","events_url":"https://api.github.com/users/alexlyp/events{/privacy}","received_events_url":"https://api.github.com/users/alexlyp/received_events","type":"User","site_admin":false},"repo":{"id":37477881,"node_id":"MDEwOlJlcG9zaXRvcnkzNzQ3Nzg4MQ==","name":"btcwallet","full_name":"alexlyp/btcwallet","private":false,"owner":{"login":"alexlyp","id":4388501,"node_id":"MDQ6VXNlcjQzODg1MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/4388501?v=4","gravatar_id":"","url":"https://api.github.com/users/alexlyp","html_url":"https://github.com/alexlyp","followers_url":"https://api.github.com/users/alexlyp/followers","following_url":"https://api.github.com/users/alexlyp/following{/other_user}","gists_url":"https://api.github.com/users/alexlyp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlyp/subscriptions","organizations_url":"https://api.github.com/users/alexlyp/orgs","repos_url":"https://api.github.com/users/alexlyp/repos","events_url":"https://api.github.com/users/alexlyp/events{/privacy}","received_events_url":"https://api.github.com/users/alexlyp/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alexlyp/btcwallet","description":"A secure bitcoin wallet daemon written in Go (golang)","fork":true,"url":"https://api.github.com/repos/alexlyp/btcwallet","forks_url":"https://api.github.com/repos/alexlyp/btcwallet/forks","keys_url":"https://api.github.com/repos/alexlyp/btcwallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexlyp/btcwallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexlyp/btcwallet/teams","hooks_url":"https://api.github.com/repos/alexlyp/btcwallet/hooks","issue_events_url":"https://api.github.com/repos/alexlyp/btcwallet/issues/events{/number}","events_url":"https://api.github.com/repos/alexlyp/btcwallet/events","assignees_url":"https://api.github.com/repos/alexlyp/btcwallet/assignees{/user}","branches_url":"https://api.github.com/repos/alexlyp/btcwallet/branches{/branch}","tags_url":"https://api.github.com/repos/alexlyp/btcwallet/tags","blobs_url":"https://api.github.com/repos/alexlyp/btcwallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexlyp/btcwallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexlyp/btcwallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexlyp/btcwallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexlyp/btcwallet/statuses/{sha}","languages_url":"https://api.github.com/repos/alexlyp/btcwallet/languages","stargazers_url":"https://api.github.com/repos/alexlyp/btcwallet/stargazers","contributors_url":"https://api.github.com/repos/alexlyp/btcwallet/contributors","subscribers_url":"https://api.github.com/repos/alexlyp/btcwallet/subscribers","subscription_url":"https://api.github.com/repos/alexlyp/btcwallet/subscription","commits_url":"https://api.github.com/repos/alexlyp/btcwallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexlyp/btcwallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexlyp/btcwallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexlyp/btcwallet/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexlyp/btcwallet/contents/{+path}","compare_url":"https://api.github.com/repos/alexlyp/btcwallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexlyp/btcwallet/merges","archive_url":"https://api.github.com/repos/alexlyp/btcwallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexlyp/btcwallet/downloads","issues_url":"https://api.github.com/repos/alexlyp/btcwallet/issues{/number}","pulls_url":"https://api.github.com/repos/alexlyp/btcwallet/pulls{/number}","milestones_url":"https://api.github.com/repos/alexlyp/btcwallet/milestones{/number}","notifications_url":"https://api.github.com/repos/alexlyp/btcwallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexlyp/btcwallet/labels{/name}","releases_url":"https://api.github.com/repos/alexlyp/btcwallet/releases{/id}","deployments_url":"https://api.github.com/repos/alexlyp/btcwallet/deployments","created_at":"2015-06-15T16:44:13Z","updated_at":"2018-02-12T19:35:24Z","pushed_at":"2018-10-23T16:31:43Z","git_url":"git://github.com/alexlyp/btcwallet.git","ssh_url":"git@github.com:alexlyp/btcwallet.git","clone_url":"https://github.com/alexlyp/btcwallet.git","svn_url":"https://github.com/alexlyp/btcwallet","homepage":"","size":14808,"stargazers_count":1,"watchers_count":1,"language":"Go","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":null,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"decred:master","ref":"master","sha":"1c1e1834c8edae272eb0430e544e180c60d74d76","user":{"login":"decred","id":16297194,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Mjk3MTk0","avatar_url":"https://avatars3.githubusercontent.com/u/16297194?v=4","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"repo":{"id":50457727,"node_id":"MDEwOlJlcG9zaXRvcnk1MDQ1NzcyNw==","name":"dcrwallet","full_name":"decred/dcrwallet","private":false,"owner":{"login":"decred","id":16297194,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Mjk3MTk0","avatar_url":"https://avatars3.githubusercontent.com/u/16297194?v=4","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/decred/dcrwallet","description":"A secure Decred wallet daemon written in Go (golang).","fork":true,"url":"https://api.github.com/repos/decred/dcrwallet","forks_url":"https://api.github.com/repos/decred/dcrwallet/forks","keys_url":"https://api.github.com/repos/decred/dcrwallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/decred/dcrwallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/decred/dcrwallet/teams","hooks_url":"https://api.github.com/repos/decred/dcrwallet/hooks","issue_events_url":"https://api.github.com/repos/decred/dcrwallet/issues/events{/number}","events_url":"https://api.github.com/repos/decred/dcrwallet/events","assignees_url":"https://api.github.com/repos/decred/dcrwallet/assignees{/user}","branches_url":"https://api.github.com/repos/decred/dcrwallet/branches{/branch}","tags_url":"https://api.github.com/repos/decred/dcrwallet/tags","blobs_url":"https://api.github.com/repos/decred/dcrwallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/decred/dcrwallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/decred/dcrwallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/decred/dcrwallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/decred/dcrwallet/statuses/{sha}","languages_url":"https://api.github.com/repos/decred/dcrwallet/languages","stargazers_url":"https://api.github.com/repos/decred/dcrwallet/stargazers","contributors_url":"https://api.github.com/repos/decred/dcrwallet/contributors","subscribers_url":"https://api.github.com/repos/decred/dcrwallet/subscribers","subscription_url":"https://api.github.com/repos/decred/dcrwallet/subscription","commits_url":"https://api.github.com/repos/decred/dcrwallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/decred/dcrwallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/decred/dcrwallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/decred/dcrwallet/issues/comments{/number}","contents_url":"https://api.github.com/repos/decred/dcrwallet/contents/{+path}","compare_url":"https://api.github.com/repos/decred/dcrwallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/decred/dcrwallet/merges","archive_url":"https://api.github.com/repos/decred/dcrwallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/decred/dcrwallet/downloads","issues_url":"https://api.github.com/repos/decred/dcrwallet/issues{/number}","pulls_url":"https://api.github.com/repos/decred/dcrwallet/pulls{/number}","milestones_url":"https://api.github.com/repos/decred/dcrwallet/milestones{/number}","notifications_url":"https://api.github.com/repos/decred/dcrwallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/decred/dcrwallet/labels{/name}","releases_url":"https://api.github.com/repos/decred/dcrwallet/releases{/id}","deployments_url":"https://api.github.com/repos/decred/dcrwallet/deployments","created_at":"2016-01-26T20:40:34Z","updated_at":"2018-10-12T15:53:17Z","pushed_at":"2018-10-23T16:31:45Z","git_url":"git://github.com/decred/dcrwallet.git","ssh_url":"git@github.com:decred/dcrwallet.git","clone_url":"https://github.com/decred/dcrwallet.git","svn_url":"https://github.com/decred/dcrwallet","homepage":"https://decred.org","size":8945,"stargazers_count":126,"watchers_count":126,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":94,"mirror_url":null,"archived":false,"open_issues_count":99,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":94,"open_issues":99,"watchers":126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/decred/dcrwallet/pulls/1307"},"html":{"href":"https://github.com/decred/dcrwallet/pull/1307"},"issue":{"href":"https://api.github.com/repos/decred/dcrwallet/issues/1307"},"comments":{"href":"https://api.github.com/repos/decred/dcrwallet/issues/1307/comments"},"review_comments":{"href":"https://api.github.com/repos/decred/dcrwallet/pulls/1307/comments"},"review_comment":{"href":"https://api.github.com/repos/decred/dcrwallet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/decred/dcrwallet/pulls/1307/commits"},"statuses":{"href":"https://api.github.com/repos/decred/dcrwallet/statuses/86a93f842e43618d4d6698f72df49e11ec5da336"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jrick"}}