-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc: Add SetVspdVoteChoice request #1981
Conversation
7bf807c
to
60acf13
Compare
internal/vsp/feepayment.go
Outdated
if len(ticketTx.TxOut) != 3 { | ||
return fmt.Errorf("ticket %v has multiple commitments: %w", ticketHash, errNotSolo) | ||
} | ||
|
||
if !stake.IsSStx(ticketTx) { | ||
return fmt.Errorf("%v is not a ticket", ticketHash) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's reverse these two checks, so if it does not have 3 outputs and is not a ticket, we don't report it as one.
internal/vsp/vsp.go
Outdated
@@ -241,3 +241,38 @@ func (c *Client) ProcessWithPolicy(ctx context.Context, ticketHash *chainhash.Ha | |||
} | |||
return fp.submitPayment() | |||
} | |||
|
|||
// SetVoteChoice takes all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to finish comment
internal/vsp/vsp.go
Outdated
c.mu.Lock() | ||
_, ok := c.jobs[*hash] | ||
c.mu.Unlock() | ||
if ok { | ||
// Already processing this ticket with the VSP. | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent us from setting vote choices for any ticket being processed. I believe you meant to test for !ok.
internal/vsp/feepayment.go
Outdated
@@ -630,6 +630,66 @@ func (c *Client) status(ctx context.Context, ticketHash *chainhash.Hash) (*ticke | |||
return &resp, nil | |||
} | |||
|
|||
func (c *Client) setVoteStatus(ctx context.Context, ticketHash *chainhash.Hash, choices []wallet.AgendaChoice) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setVoteChoices
perhaps.
This command connects with the provided VSP host/pubkey and updates any ticket voting choice that VSP may control for the wallet.