mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-04 18:01:57 +01:00
htlcswitch.test: add server error channel to concurrent access panic
This commit where added as a measure to avoid the panic during several server simultanoius fault. The panic happened becuase *t.Testing structure is not concurrent safe.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
1eb906bcfb
commit
e170b43615
@@ -508,13 +508,14 @@ func (n *threeHopNetwork) stop() {
|
||||
// channel link channel link channel link channel link
|
||||
//
|
||||
func newThreeHopNetwork(t *testing.T, aliceToBob,
|
||||
bobToCarol btcutil.Amount, startingHeight uint32) *threeHopNetwork {
|
||||
bobToCarol btcutil.Amount, serverErr chan error,
|
||||
startingHeight uint32) *threeHopNetwork {
|
||||
var err error
|
||||
|
||||
// Create three peers/servers.
|
||||
aliceServer := newMockServer(t, "alice")
|
||||
bobServer := newMockServer(t, "bob")
|
||||
carolServer := newMockServer(t, "carol")
|
||||
aliceServer := newMockServer("alice", serverErr)
|
||||
bobServer := newMockServer("bob", serverErr)
|
||||
carolServer := newMockServer("carol", serverErr)
|
||||
|
||||
// Create mock decoder instead of sphinx one in order to mock the
|
||||
// route which htlc should follow.
|
||||
|
||||
Reference in New Issue
Block a user