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.
251{252setDataDirectory(GUIUtil::getDefaultDataDirectory());253}255void Intro::on_dataDirCustom_clicked()256{257ui->dataDirectory->setEnabled(true);258ui->ellipsisButton->setEnabled(true);259}261void Intro::startThread()262{263thread = new QThread(this);264FreespaceChecker *executor = new FreespaceChecker(this);265executor->moveToThread(thread);267connect(executor, &FreespaceChecker::reply, this, &Intro::setStatus);268connect(this, &Intro::requestCheck, executor, &FreespaceChecker::check);269/* make sure executor object is deleted in its own thread */270connect(thread, &QThread::finished, executor, &QObject::deleteLater);272thread->start();273}275void Intro::checkPath(const QString &dataDir)276{277mutex.lock();278pathToCheck = dataDir;279if(!signalled)280{281signalled = true;282Q_EMIT requestCheck();283}284mutex.unlock();285}287QString Intro::getPathToCheck()288{289QString retval;290mutex.lock();291retval = pathToCheck;292signalled = false; /* new request can be queued now */293mutex.unlock();294return retval;295}297void Intro::UpdatePruneLabels(bool prune_checked)298{299m_required_space_gb = m_blockchain_size_gb + m_chain_state_size_gb;300QString storageRequiresMsg = tr("At least %1 GB of data will be stored in this directory, and it will grow over time.");301if (prune_checked && m_prune_target_gb <= m_blockchain_size_gb) {302m_required_space_gb = m_prune_target_gb + m_chain_state_size_gb;303storageRequiresMsg = tr("Approximately %1 GB of data will be stored in this directory.");304}305ui->lblExplanation3->setVisible(prune_checked);306ui->pruneGB->setEnabled(prune_checked);307static constexpr uint64_t nPowTargetSpacing = 10 * 60; // from chainparams, which we don't have at this stage308static constexpr uint32_t expected_block_data_size = 2250000; // includes undo data309const uint64_t expected_backup_days = m_prune_target_gb * 1e9 / (uint64_t(expected_block_data_size) * 86400 / nPowTargetSpacing);310ui->lblPruneSuffix->setText(311//: Explanatory text on the capability of the current prune target.312tr("(sufficient to restore backups %n day(s) old)", "", expected_backup_days));313ui->sizeWarningLabel->setText(314tr("%1 will download and store a copy of the Bitcoin block chain.").arg(CLIENT_NAME) + " " +315storageRequiresMsg.arg(m_required_space_gb) + " " +316tr("The wallet will also be stored in this directory.")317);318this->adjustSize();319}
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.