From 07a42971bfd50d964cff59540427fef44599281f Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Fri, 6 Sep 2019 13:14:39 +0200 Subject: [PATCH] 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. --- lnwallet/test_utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lnwallet/test_utils.go b/lnwallet/test_utils.go index 37f13c55..32c6db95 100644 --- a/lnwallet/test_utils.go +++ b/lnwallet/test_utils.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "io" "io/ioutil" + prand "math/rand" "net" "os" @@ -102,7 +103,7 @@ func CreateTestChannels() (*LightningChannel, *LightningChannel, func(), error) prevOut := &wire.OutPoint{ Hash: chainhash.Hash(testHdSeed), - Index: 0, + Index: prand.Uint32(), } fundingTxIn := wire.NewTxIn(prevOut, nil, nil)