bitcoin/src/qt/initexecutor.h
MarcoFalke fa5f297748
scripted-diff: [doc] Unify stale copyright headers
-BEGIN VERIFY SCRIPT-

 sed --in-place --regexp-extended \
   's;( 20[0-2][0-9])(-20[0-2][0-9])? The Bitcoin Core developers;\1-present The Bitcoin Core developers;g' \
   $( git grep -l 'The Bitcoin Core developers' -- ':(exclude)COPYING' ':(exclude)src/ipc/libmultiprocess' ':(exclude)src/minisketch' )

-END VERIFY SCRIPT-
2025-12-16 22:21:15 +01:00

48 lines
1.1 KiB
C++

// Copyright (c) 2014-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_INITEXECUTOR_H
#define BITCOIN_QT_INITEXECUTOR_H
#include <interfaces/node.h>
#include <exception>
#include <QObject>
#include <QThread>
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
/** Class encapsulating Bitcoin Core startup and shutdown.
* Allows running startup and shutdown in a different thread from the UI thread.
*/
class InitExecutor : public QObject
{
Q_OBJECT
public:
explicit InitExecutor(interfaces::Node& node);
~InitExecutor();
public Q_SLOTS:
void initialize();
void shutdown();
Q_SIGNALS:
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
void shutdownResult();
void runawayException(const QString& message);
private:
/// Pass fatal exception message to UI thread
void handleRunawayException(const std::exception* e);
interfaces::Node& m_node;
QObject m_context;
QThread m_thread;
};
#endif // BITCOIN_QT_INITEXECUTOR_H