Skip to content
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

Add optional locktime parameter to CreateRawTransaction APIs. #24

Merged
merged 2 commits into from
May 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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