MCPcopy Create free account
hub / github.com/LUX-Core/lux / Shutdown

Function Shutdown

src/init.cpp:292–308  ·  view source on GitHub ↗

* Shutdown is split into 2 parts: * Part 1: shut down everything but the main wallet instance (done in PrepareShutdown() ) * Part 2: delete wallet instance * * In case of a restart PrepareShutdown() was already called before, but this method here gets * called implicitly when the parent object is deleted. In this case we have to skip the * PrepareShutdown() part because it was already executed and

Source from the content-addressed store, hash-verified

290* PrepareShutdown() part because it was already executed and just delete the wallet instance.
291*/
292void Shutdown()
293{
294 // Shutdown part 1: prepare shutdown
295 if(!fRequestRestart) {
296 PrepareShutdown();
297 }
298
299// Shutdown part 2: delete wallet instance
300 StopLuxControl();
301#ifdef ENABLE_WALLET
302 delete pwalletMain;
303 pwalletMain = NULL;
304#endif
305 globalVerifyHandle.reset();
306 ECC_Stop();
307 LogPrintf("%s: done\n", __func__);
308}
309
310/**
311 * Signal handlers are very limited in what they are allowed to do, so:

Callers 1

AppInitFunction · 0.70

Calls 4

PrepareShutdownFunction · 0.85
StopLuxControlFunction · 0.85
ECC_StopFunction · 0.85
resetMethod · 0.45

Tested by

no test coverage detected