diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-12 11:09:21 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-12 11:09:21 +0000 |
commit | cf2e75ebb310f619e7598b7981f471ad7e788ce4 (patch) | |
tree | fb6824d8d9358f8bc73e5a33432f51f4f3936454 | |
parent | Merge pull request #1698 (diff) | |
download | monero-cf2e75ebb310f619e7598b7981f471ad7e788ce4.tar.xz |
daemon: fix crash on exit when mining
When exiting while the miner is running, finding a block after
the p2p layer has been shutdown will cause a crash as the now
uninitialized p2p layer is asked to relay the found block to
any peers.
-rw-r--r-- | src/daemon/daemon.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index e40136a71..19013cbc8 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -141,6 +141,7 @@ bool t_daemon::run(bool interactive) } mp_internals->rpc.stop(); + mp_internals->core.get().get_miner().stop(); MGINFO("Node stopped."); return true; } @@ -162,6 +163,7 @@ void t_daemon::stop() { throw std::runtime_error{"Can't stop stopped daemon"}; } + mp_internals->core.get().get_miner().stop(); mp_internals->p2p.stop(); mp_internals->rpc.stop(); mp_internals.reset(nullptr); // Ensure resources are cleaned up before we return |