This adds a time.Sleep() call before stopping the gRPC server used for
the wallet unlocker service and consequently before closing the
listeners for the given server.
Some gRPC client libraries, such as grpc-js used in nodejs/Electron apps
(i.e. Decrediton) have trouble processing the response to a call if the
socket is closed immediately after the response is returned.
The gRPC library currently used in dcrlnd does not offer any method of
identifying whether there are outstanding calls or clients, therefore we
resort to a simple sleep that, while not fundamentally fixing the
underlying issue, alleviates it for the most common use case.
This adds a time.Sleep() call before stopping the gRPC server used for the wallet unlocker service and consequently before closing the listeners for the given server.
Some gRPC client libraries, such as grpc-js used in nodejs/Electron apps (i.e. Decrediton) have trouble processing the response to a call if the socket is closed immediately after the response is returned.
The gRPC library currently used in dcrlnd does not offer any method of identifying whether there are outstanding calls or clients, therefore we resort to a simple sleep that, while not fundamentally fixing the underlying issue, alleviates it for the most common use case.