Skip to content

Commit

Permalink
multi: revert TicketChange addition to PurchaseTicketCmd
Browse files Browse the repository at this point in the history
This reverts the split_tx/ticket_change addition to PurchaseTickeCmd. From a discussion had with raedah and jrick on purchasing tickets we concluded that change created by direct ticket purchases will adhere to coinbase maturity before becoming available for spending. We will not be circumventing this by not setting the expiry for sstxchange.

The only ideal scenario currently for purchasing tickets directly is with inputs equal to the stake difficulty plus the fee.
  • Loading branch information
dnldd authored and davecgh committed Jun 12, 2018
1 parent 53ec802 commit 5386a63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions dcrjson/walletsvrcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,13 @@ type PurchaseTicketCmd struct {
PoolFees *float64
Expiry *int
Comment *string
TicketChange *bool
TicketFee *float64
}

// NewPurchaseTicketCmd creates a new PurchaseTicketCmd.
func NewPurchaseTicketCmd(fromAccount string, spendLimit float64, minConf *int,
ticketAddress *string, numTickets *int, poolAddress *string, poolFees *float64,
expiry *int, comment *string, ticketChange *bool, ticketFee *float64) *PurchaseTicketCmd {
expiry *int, comment *string, ticketFee *float64) *PurchaseTicketCmd {
return &PurchaseTicketCmd{
FromAccount: fromAccount,
SpendLimit: spendLimit,
Expand All @@ -749,7 +748,6 @@ func NewPurchaseTicketCmd(fromAccount string, spendLimit float64, minConf *int,
PoolFees: poolFees,
Expiry: expiry,
Comment: comment,
TicketChange: ticketChange,
TicketFee: ticketFee,
}
}
Expand Down
6 changes: 3 additions & 3 deletions rpcclient/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ func (r FuturePurchaseTicketResult) Receive() ([]*chainhash.Hash, error) {
func (c *Client) PurchaseTicketAsync(fromAccount string,
spendLimit dcrutil.Amount, minConf *int, ticketAddress dcrutil.Address,
numTickets *int, poolAddress dcrutil.Address, poolFees *dcrutil.Amount,
expiry *int, ticketChange *bool, ticketFee *dcrutil.Amount) FuturePurchaseTicketResult {
expiry *int, ticketFee *dcrutil.Amount) FuturePurchaseTicketResult {
// An empty string is used to keep the sendCmd
// passing of the command from accidentally
// removing certain fields. We fill in the
Expand Down Expand Up @@ -805,7 +805,7 @@ func (c *Client) PurchaseTicketAsync(fromAccount string,

cmd := dcrjson.NewPurchaseTicketCmd(fromAccount, spendLimit.ToCoin(),
&minConfVal, &ticketAddrStr, &numTicketsVal, &poolAddrStr,
&poolFeesFloat, &expiryVal, dcrjson.String(""), ticketChange, &ticketFeeFloat)
&poolFeesFloat, &expiryVal, dcrjson.String(""), &ticketFeeFloat)

return c.sendCmd(cmd)
}
Expand All @@ -818,7 +818,7 @@ func (c *Client) PurchaseTicket(fromAccount string,
expiry *int, ticketChange *bool, ticketFee *dcrutil.Amount) ([]*chainhash.Hash, error) {

return c.PurchaseTicketAsync(fromAccount, spendLimit, minConf, ticketAddress,
numTickets, poolAddress, poolFees, expiry, ticketChange, ticketFee).Receive()
numTickets, poolAddress, poolFees, expiry, ticketFee).Receive()
}

// SStx generation RPC call handling
Expand Down

0 comments on commit 5386a63

Please sign in to comment.