cmd/swarm/swarm-smoke-pss: close rpc clients

This commit is contained in:
Rafael Matias 2019-03-25 22:56:47 +01:00
parent 0a366c3d40
commit 97be51930c
No known key found for this signature in database
GPG key ID: 1BC39532FB4A2DBD

View file

@ -31,7 +31,6 @@ type pssNode struct {
pubkey string
client *rpc.Client
deregisterFunc func()
msgC chan pss.APIMsg
}
type pssSession struct {
@ -162,17 +161,21 @@ func pssSetup() *pssSession {
log.Error("error calling host for subscribe", "err", err)
continue
}
var dFn = func() {
sub.Unsubscribe()
rpcClient.Close()
}
session.nodes = append(session.nodes,
&pssNode{
hostIdx: i,
addr: []byte(addr),
client: rpcClient,
pubkey: pubkey,
deregisterFunc: sub.Unsubscribe,
deregisterFunc: dFn,
},
)
}
return session
}