Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2011-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_QT_INTRO_H6#define BITCOIN_QT_INTRO_H8#include <qt/freespacechecker.h>10#include <QDialog>11#include <QMutex>12#include <QThread>14inline constexpr bool DEFAULT_CHOOSE_DATADIR = false;16namespace interfaces {17class Node;18}20namespace Ui {21class Intro;22}24/** Introduction screen (pre-GUI startup).25Allows the user to choose a data directory,26in which the wallet and block chain will be stored.27*/28class Intro : public QDialog, public FreespaceChecker::PathQuery29{30Q_OBJECT32public:33explicit Intro(QWidget *parent = nullptr,34int64_t blockchain_size_gb = 0, int64_t chain_state_size_gb = 0);35~Intro();37QString getDataDirectory();38void setDataDirectory(const QString &dataDir);39int64_t getPruneMiB() const;41/**42* Determine data directory. Let the user choose if the current one doesn't exist.43* Let the user configure additional preferences such as pruning.44*45* @returns true if a data directory was selected, false if the user cancelled the selection46* dialog.47*48* @note do NOT call global gArgs.GetDataDirNet() before calling this function, this49* will cause the wrong path to be cached.50*/51static bool showIfNeeded(bool& did_show_intro, int64_t& prune_MiB);53Q_SIGNALS:54void requestCheck();56public Q_SLOTS:57void setStatus(int status, const QString &message, quint64 bytesAvailable);59private Q_SLOTS:60void on_dataDirectory_textChanged(const QString &arg1);61void on_ellipsisButton_clicked();62void on_dataDirDefault_clicked();63void on_dataDirCustom_clicked();65private:66Ui::Intro *ui;67bool m_prune_checkbox_is_default{true};68QThread* thread{nullptr};69QMutex mutex;70bool signalled{false};71QString pathToCheck;72const int64_t m_blockchain_size_gb;73const int64_t m_chain_state_size_gb;74//! Total required space (in GB) depending on user choice (prune or not prune).75int64_t m_required_space_gb{0};76uint64_t m_bytes_available{0};77int64_t m_prune_target_gb;79void startThread();80void checkPath(const QString &dataDir);81QString getPathToCheck() override;82void UpdatePruneLabels(bool prune_checked);83void UpdateFreeSpaceLabel();85friend class FreespaceChecker;86};88#endif // BITCOIN_QT_INTRO_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.