diff --git a/src/rpc.cpp b/src/rpc.cpp index fa205b9..562a6da 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -213,6 +213,10 @@ void RPC::sendZTransaction(json params, const std::function& cb) { * private keys */ void RPC::getAllPrivKeys(const std::function>)> cb) { + if (conn == nullptr) { + // No connection, just return + return; + } // A special function that will call the callback when two lists have been added auto holder = new QPair>>(); @@ -813,6 +817,12 @@ void RPC::refreshZECPrice() { } void RPC::shutdownZcashd() { + // Shutdown embedded zcashd if it was started + if (ezcashd == nullptr || conn == nullptr) { + // No zcashd running internally, just return + return; + } + json payload = { {"jsonrpc", "1.0"}, {"id", "someid"},