Skip to content

Commit

Permalink
Add optional locktime parameter to CreateRawTransaction APIs.
Browse files Browse the repository at this point in the history
Upstream commit c560720
  • Loading branch information
davecgh committed May 21, 2016
2 parents 0e48ddc + c560720 commit 7df7e90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rawtransactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,22 @@ func (r FutureCreateRawTransactionResult) Receive() (*wire.MsgTx, error) {
//
// See CreateRawTransaction for the blocking version and more details.
func (c *Client) CreateRawTransactionAsync(inputs []dcrjson.TransactionInput,
amounts map[dcrutil.Address]dcrutil.Amount) FutureCreateRawTransactionResult {
amounts map[dcrutil.Address]dcrutil.Amount, lockTime *int64) FutureCreateRawTransactionResult {

convertedAmts := make(map[string]float64, len(amounts))
for addr, amount := range amounts {
convertedAmts[addr.String()] = amount.ToCoin()
}
cmd := dcrjson.NewCreateRawTransactionCmd(inputs, convertedAmts)
cmd := dcrjson.NewCreateRawTransactionCmd(inputs, convertedAmts, lockTime)
return c.sendCmd(cmd)
}

// CreateRawTransaction returns a new transaction spending the provided inputs
// and sending to the provided addresses.
func (c *Client) CreateRawTransaction(inputs []dcrjson.TransactionInput,
amounts map[dcrutil.Address]dcrutil.Amount) (*wire.MsgTx, error) {
amounts map[dcrutil.Address]dcrutil.Amount, lockTime *int64) (*wire.MsgTx, error) {

return c.CreateRawTransactionAsync(inputs, amounts).Receive()
return c.CreateRawTransactionAsync(inputs, amounts, lockTime).Receive()
}

// FutureCreateRawSStxResult is a future promise to deliver the result
Expand Down

0 comments on commit 7df7e90

Please sign in to comment.