Add optional locktime parameter to CreateRawTransaction APIs.
This commit is contained in:
parent
29a2544887
commit
c56072017d
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue