diff --git a/coinset/coins.go b/coinset/coins.go index 17ee5ce..1d8f4a3 100644 --- a/coinset/coins.go +++ b/coinset/coins.go @@ -124,8 +124,8 @@ func (cs *CoinSet) removeElement(e *list.Element) Coin { // NewMsgTxWithInputCoins takes the coins in the CoinSet and makes them // the inputs to a new wire.MsgTx which is returned. -func NewMsgTxWithInputCoins(inputCoins Coins) *wire.MsgTx { - msgTx := wire.NewMsgTx() +func NewMsgTxWithInputCoins(txVersion int32, inputCoins Coins) *wire.MsgTx { + msgTx := wire.NewMsgTx(txVersion) coins := inputCoins.Coins() msgTx.TxIn = make([]*wire.TxIn, len(coins)) for i, coin := range coins { diff --git a/coinset/coins_test.go b/coinset/coins_test.go index 9d8aebd..56f095e 100644 --- a/coinset/coins_test.go +++ b/coinset/coins_test.go @@ -109,7 +109,7 @@ func TestCoinSet(t *testing.T) { t.Error("Expected first coin") } - mtx := coinset.NewMsgTxWithInputCoins(cs) + mtx := coinset.NewMsgTxWithInputCoins(wire.TxVersion, cs) if len(mtx.TxIn) != 1 { t.Errorf("Expected only 1 TxIn, got %d", len(mtx.TxIn)) }