decred / dcrwallet

A secure Decred wallet daemon written in Go (golang).
https://decred.org
ISC License
219 stars 156 forks source link

ticketbuyer.votingaccount not being used with purchaseticket #1637

Open raedah opened 4 years ago

raedah commented 4 years ago

The configured voting account is used when doing coinjoins, but is not used when doing a standard purchaseticket. Expected behavior is for the configured votingaccount to apply to all ticket purchases.

jrick commented 4 years ago

The purchaseticket method needs to be replaced with something more flexible. Here is the problem:

$ dcrctl -l | grep purchaseticket
purchaseticket "fromaccount" spendlimit (minconf=1 "ticketaddress" numtickets "pooladdress" poolfees expiry "comment" ticketfee)

There's no place to specify a voting account without also specifying a voting address (which is nonsensical, but could be the empty string), VSP options (which don't support anything but a static voting address, therefore also nonsensical), and an unused comment field.

We can't use the application defaults, because by precedence, this RPC does not use those application options anyways, instead requiring the caller to pass them in each time.