Skip to content

Commit 9af2549

Browse files
committed
qt: Factor out requestNodeShutdown() slot
1 parent 753103d commit 9af2549

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
@@ -339,8 +339,6 @@ void BitcoinApplication::requestShutdown()
339339
// for example the RPC console may still be executing a command.
340340
shutdownWindow.reset(ShutdownWindow::showShutdownWindow(window));
341341

342-
qDebug() << __func__ << ": Requesting shutdown";
343-
startThread();
344342
window->hideAll();
345343
// Must disconnect node signals otherwise current thread can deadlock since
346344
// no event loop is running.
@@ -356,8 +354,7 @@ void BitcoinApplication::requestShutdown()
356354
delete clientModel;
357355
clientModel = nullptr;
358356

359-
// Request shutdown from core thread
360-
Q_EMIT requestedShutdown();
357+
requestNodeShutdown();
361358
}
362359

363360
void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info)
@@ -411,6 +408,14 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
411408
}
412409
}
413410

411+
void BitcoinApplication::requestNodeShutdown()
412+
{
413+
qDebug() << __func__ << ": Requesting shutdown";
414+
startThread();
415+
// Request shutdown from core thread
416+
Q_EMIT requestedShutdown();
417+
}
418+
414419
void BitcoinApplication::shutdownResult()
415420
{
416421
quit();

src/qt/bitcoin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public Q_SLOTS:
9595
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
9696
/// Request core shutdown
9797
void requestShutdown();
98+
void requestNodeShutdown();
9899
void shutdownResult();
99100
/// Handle runaway exceptions. Shows a message box with the problem and quits the program.
100101
void handleRunawayException(const QString &message);

0 commit comments

Comments
 (0)