autostart zcashd

This commit is contained in:
Aditya Kulkarni
2018-11-02 22:20:31 -07:00
parent 1e9289095f
commit 46f2f7f02e
6 changed files with 113 additions and 17 deletions

View File

@@ -807,3 +807,19 @@ void RPC::refreshZECPrice() {
Settings::getInstance()->setZECPrice(0);
});
}
void RPC::shutdownZcashd() {
json payload = {
{"jsonrpc", "1.0"},
{"id", "someid"},
{"method", "stop"}
};
conn->doRPCWithDefaultErrorHandling(payload, [=](auto) {});
}
void RPC::closeEvent() {
if (Settings::getInstance()->isEmbeddedZcashdRunning()) {
shutdownZcashd();
}
}