Skip to content

Commit 9495d26

Browse files
committed
qt: Factor out requestNodeShutdown() slot
1 parent e2d0fc8 commit 9495d26

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/qt/bitcoin.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,6 @@ void BitcoinApplication::requestShutdown()
324324
// for example the RPC console may still be executing a command.
325325
shutdownWindow.reset(ShutdownWindow::showShutdownWindow(window));
326326

327-
qDebug() << __func__ << ": Requesting shutdown";
328-
startThread();
329327
window->clearGUI();
330328
// Must disconnect node signals otherwise current thread can deadlock since
331329
// no event loop is running.
@@ -341,8 +339,7 @@ void BitcoinApplication::requestShutdown()
341339
delete clientModel;
342340
clientModel = nullptr;
343341

344-
// Request shutdown from core thread
345-
Q_EMIT requestedShutdown();
342+
requestNodeShutdown();
346343
}
347344

348345
void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info)
@@ -396,6 +393,14 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
396393
}
397394
}
398395

396+
void BitcoinApplication::requestNodeShutdown()
397+
{
398+
qDebug() << __func__ << ": Requesting shutdown";
399+
startThread();
400+
// Request shutdown from core thread
401+
Q_EMIT requestedShutdown();
402+
}
403+
399404
void BitcoinApplication::shutdownResult()
400405
{
401406
quit();

src/qt/bitcoin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public Q_SLOTS:
9090
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
9191
/// Request core shutdown
9292
void requestShutdown();
93+
void requestNodeShutdown();
9394
void shutdownResult();
9495
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
9596
void handleRunawayException(const QString &message);

0 commit comments

Comments
 (0)