Skip to content

Commit e1965ea

Browse files
committed
cmd/wasm-client: set lndConn to nil on disconnect
1 parent fac6433 commit e1965ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/wasm-client/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ func (w *wasmClient) ConnectServer(_ js.Value, args []js.Value) interface{} {
250250

251251
w.statusChecker = statusChecker
252252
w.lndConn, err = lndConnect()
253+
if err != nil {
254+
exit(err)
255+
}
253256

254257
log.Debugf("WASM client connected to RPC")
255258
}()
@@ -266,6 +269,7 @@ func (w *wasmClient) Disconnect(_ js.Value, _ []js.Value) interface{} {
266269
if err := w.lndConn.Close(); err != nil {
267270
log.Errorf("Error closing RPC connection: %v", err)
268271
}
272+
w.lndConn = nil
269273
}
270274

271275
return nil

0 commit comments

Comments
 (0)