lnwallet/test_utils: make CreateTestChannel return random funding op

Previously it would always be the same, resulting in multiple calls to
the method not being usabel to create more than one set of channels.
This commit is contained in:
Johan T. Halseth
2019-09-06 13:14:39 +02:00
parent 425afd28ea
commit 07a42971bf

View File

@ -7,6 +7,7 @@ import (
"encoding/hex" "encoding/hex"
"io" "io"
"io/ioutil" "io/ioutil"
prand "math/rand"
"net" "net"
"os" "os"
@ -102,7 +103,7 @@ func CreateTestChannels() (*LightningChannel, *LightningChannel, func(), error)
prevOut := &wire.OutPoint{ prevOut := &wire.OutPoint{
Hash: chainhash.Hash(testHdSeed), Hash: chainhash.Hash(testHdSeed),
Index: 0, Index: prand.Uint32(),
} }
fundingTxIn := wire.NewTxIn(prevOut, nil, nil) fundingTxIn := wire.NewTxIn(prevOut, nil, nil)