mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/swarm/swarm-smoke-pss: close rpc clients
This commit is contained in:
parent
0a366c3d40
commit
97be51930c
1 changed files with 6 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue