From c56072017d2c4c1247ed1c2ae04c461cec284779 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 27 Oct 2015 12:34:11 -0400 Subject: [PATCH] Add optional locktime parameter to CreateRawTransaction APIs. --- rawtransactions.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rawtransactions.go b/rawtransactions.go index 5ea45e9..aa24f61 100644 --- a/rawtransactions.go +++ b/rawtransactions.go @@ -238,22 +238,22 @@ func (r FutureCreateRawTransactionResult) Receive() (*wire.MsgTx, error) { // // See CreateRawTransaction for the blocking version and more details. func (c *Client) CreateRawTransactionAsync(inputs []btcjson.TransactionInput, - amounts map[btcutil.Address]btcutil.Amount) FutureCreateRawTransactionResult { + amounts map[btcutil.Address]btcutil.Amount, lockTime *int64) FutureCreateRawTransactionResult { convertedAmts := make(map[string]float64, len(amounts)) for addr, amount := range amounts { convertedAmts[addr.String()] = amount.ToBTC() } - cmd := btcjson.NewCreateRawTransactionCmd(inputs, convertedAmts) + cmd := btcjson.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 []btcjson.TransactionInput, - amounts map[btcutil.Address]btcutil.Amount) (*wire.MsgTx, error) { + amounts map[btcutil.Address]btcutil.Amount, lockTime *int64) (*wire.MsgTx, error) { - return c.CreateRawTransactionAsync(inputs, amounts).Receive() + return c.CreateRawTransactionAsync(inputs, amounts, lockTime).Receive() } // FutureSendRawTransactionResult is a future promise to deliver the result