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