Bitcoin Core 28.99.0
P2P Digital Currency
optionsdialog.cpp
Go to the documentation of this file.
1// Copyright (c) 2011-2022 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <bitcoin-build-config.h> // IWYU pragma: keep
6
7#include <qt/optionsdialog.h>
8#include <qt/forms/ui_optionsdialog.h>
9
10#include <qt/bitcoinunits.h>
11#include <qt/clientmodel.h>
12#include <qt/guiconstants.h>
13#include <qt/guiutil.h>
14#include <qt/optionsmodel.h>
15
16#include <common/system.h>
17#include <interfaces/node.h>
18#include <netbase.h>
19#include <node/caches.h>
21#include <util/strencodings.h>
22
23#include <chrono>
24
25#include <QApplication>
26#include <QDataWidgetMapper>
27#include <QDir>
28#include <QFontDialog>
29#include <QIntValidator>
30#include <QLocale>
31#include <QMessageBox>
32#include <QSystemTrayIcon>
33#include <QTimer>
34
35int setFontChoice(QComboBox* cb, const OptionsModel::FontChoice& fc)
36{
37 int i;
38 for (i = cb->count(); --i >= 0; ) {
39 QVariant item_data = cb->itemData(i);
40 if (!item_data.canConvert<OptionsModel::FontChoice>()) continue;
41 if (item_data.value<OptionsModel::FontChoice>() == fc) {
42 break;
43 }
44 }
45 if (i == -1) {
46 // New item needed
47 QFont chosen_font = OptionsModel::getFontForChoice(fc);
48 QSignalBlocker block_currentindexchanged_signal(cb); // avoid triggering QFontDialog
49 cb->insertItem(0, QFontInfo(chosen_font).family(), QVariant::fromValue(fc));
50 i = 0;
51 }
52
53 cb->setCurrentIndex(i);
54 return i;
55}
56
57void setupFontOptions(QComboBox* cb, QLabel* preview)
58{
59 QFont embedded_font{GUIUtil::fixedPitchFont(true)};
60 QFont system_font{GUIUtil::fixedPitchFont(false)};
61 cb->addItem(QObject::tr("Embedded \"%1\"").arg(QFontInfo(embedded_font).family()), QVariant::fromValue(OptionsModel::FontChoice{OptionsModel::FontChoiceAbstract::EmbeddedFont}));
62 cb->addItem(QObject::tr("Default system font \"%1\"").arg(QFontInfo(system_font).family()), QVariant::fromValue(OptionsModel::FontChoice{OptionsModel::FontChoiceAbstract::BestSystemFont}));
63 cb->addItem(QObject::tr("Custom…"));
64
65 const auto& on_font_choice_changed = [cb, preview](int index) {
66 static int previous_index = -1;
67 QVariant item_data = cb->itemData(index);
68 QFont f;
69 if (item_data.canConvert<OptionsModel::FontChoice>()) {
71 } else {
72 bool ok;
73 f = QFontDialog::getFont(&ok, GUIUtil::fixedPitchFont(false), cb->parentWidget());
74 if (!ok) {
75 cb->setCurrentIndex(previous_index);
76 return;
77 }
79 }
80 if (preview) {
81 preview->setFont(f);
82 }
83 previous_index = index;
84 };
85 QObject::connect(cb, QOverload<int>::of(&QComboBox::currentIndexChanged), on_font_choice_changed);
86 on_font_choice_changed(cb->currentIndex());
87}
88
89OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
90 : QDialog(parent, GUIUtil::dialog_flags | Qt::WindowMaximizeButtonHint),
91 ui(new Ui::OptionsDialog)
92{
93 ui->setupUi(this);
94
95 ui->verticalLayout->setStretchFactor(ui->tabWidget, 1);
96
97 /* Main elements init */
98 ui->databaseCache->setRange(MIN_DB_CACHE >> 20, std::numeric_limits<int>::max());
99 ui->threadsScriptVerif->setMinimum(-GetNumCores());
100 ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS);
101 ui->pruneWarning->setVisible(false);
102 ui->pruneWarning->setStyleSheet("QLabel { color: red; }");
103
104 ui->pruneSize->setEnabled(false);
105 connect(ui->prune, &QPushButton::toggled, ui->pruneSize, &QWidget::setEnabled);
106
107 /* Network elements init */
108 ui->proxyIp->setEnabled(false);
109 ui->proxyPort->setEnabled(false);
110 ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));
111
112 ui->proxyIpTor->setEnabled(false);
113 ui->proxyPortTor->setEnabled(false);
114 ui->proxyPortTor->setValidator(new QIntValidator(1, 65535, this));
115
116 connect(ui->connectSocks, &QPushButton::toggled, ui->proxyIp, &QWidget::setEnabled);
117 connect(ui->connectSocks, &QPushButton::toggled, ui->proxyPort, &QWidget::setEnabled);
118 connect(ui->connectSocks, &QPushButton::toggled, this, &OptionsDialog::updateProxyValidationState);
119
120 connect(ui->connectSocksTor, &QPushButton::toggled, ui->proxyIpTor, &QWidget::setEnabled);
121 connect(ui->connectSocksTor, &QPushButton::toggled, ui->proxyPortTor, &QWidget::setEnabled);
122 connect(ui->connectSocksTor, &QPushButton::toggled, this, &OptionsDialog::updateProxyValidationState);
123
124 /* Window elements init */
125#ifdef Q_OS_MACOS
126 /* remove Window tab on Mac */
127 ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow));
128 /* hide launch at startup option on macOS */
129 ui->bitcoinAtStartup->setVisible(false);
130 ui->verticalLayout_Main->removeWidget(ui->bitcoinAtStartup);
131 ui->verticalLayout_Main->removeItem(ui->horizontalSpacer_0_Main);
132#endif
133
134 /* remove Wallet tab and 3rd party-URL textbox in case of -disablewallet */
135 if (!enableWallet) {
136 ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet));
137 ui->thirdPartyTxUrlsLabel->setVisible(false);
138 ui->thirdPartyTxUrls->setVisible(false);
139 }
140
141#ifdef ENABLE_EXTERNAL_SIGNER
142 ui->externalSignerPath->setToolTip(ui->externalSignerPath->toolTip().arg(CLIENT_NAME));
143#else
144 //: "External signing" means using devices such as hardware wallets.
145 ui->externalSignerPath->setToolTip(tr("Compiled without external signing support (required for external signing)"));
146 ui->externalSignerPath->setEnabled(false);
147#endif
148 /* Display elements init */
149 QDir translations(":translations");
150
151 ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(CLIENT_NAME));
152 ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(CLIENT_NAME));
153
154 ui->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().arg(CLIENT_NAME));
155
156 ui->lang->setToolTip(ui->lang->toolTip().arg(CLIENT_NAME));
157 ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
158 for (const QString &langStr : translations.entryList())
159 {
160 QLocale locale(langStr);
161
163 if(langStr.contains("_"))
164 {
166 ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") +
167#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0))
168 locale.nativeTerritoryName() +
169#else
170 locale.nativeCountryName() +
171#endif
172 QString(" (") + langStr + QString(")"), QVariant(langStr));
173
174 }
175 else
176 {
178 ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
179 }
180 }
181 ui->unit->setModel(new BitcoinUnits(this));
182
183 /* Widget-to-option mapper */
184 mapper = new QDataWidgetMapper(this);
185 mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
186 mapper->setOrientation(Qt::Vertical);
187
189 connect(delegate, &GUIUtil::ItemDelegate::keyEscapePressed, this, &OptionsDialog::reject);
190 mapper->setItemDelegate(delegate);
191
192 /* setup/change UI elements when proxy IPs are invalid/valid */
193 ui->proxyIp->setCheckValidator(new ProxyAddressValidator(parent));
194 ui->proxyIpTor->setCheckValidator(new ProxyAddressValidator(parent));
197 connect(ui->proxyPort, &QLineEdit::textChanged, this, &OptionsDialog::updateProxyValidationState);
198 connect(ui->proxyPortTor, &QLineEdit::textChanged, this, &OptionsDialog::updateProxyValidationState);
199
200 if (!QSystemTrayIcon::isSystemTrayAvailable()) {
201 ui->showTrayIcon->setChecked(false);
202 ui->showTrayIcon->setEnabled(false);
203 ui->minimizeToTray->setChecked(false);
204 ui->minimizeToTray->setEnabled(false);
205 }
206
207 setupFontOptions(ui->moneyFont, ui->moneyFont_preview);
208
210}
211
213{
214 delete ui;
215}
216
218{
219 m_client_model = client_model;
220}
221
223{
224 this->model = _model;
225
226 if(_model)
227 {
228 /* check if client restart is needed and show persistent message */
229 if (_model->isRestartRequired())
230 showRestartWarning(true);
231
232 // Prune values are in GB to be consistent with intro.cpp
233 static constexpr uint64_t nMinDiskSpace = (MIN_DISK_SPACE_FOR_BLOCK_FILES / GB_BYTES) + (MIN_DISK_SPACE_FOR_BLOCK_FILES % GB_BYTES) ? 1 : 0;
234 ui->pruneSize->setRange(nMinDiskSpace, std::numeric_limits<int>::max());
235
236 QString strLabel = _model->getOverriddenByCommandLine();
237 if (strLabel.isEmpty())
238 strLabel = tr("none");
239 ui->overriddenByCommandLineLabel->setText(strLabel);
240
241 mapper->setModel(_model);
242 setMapper();
243 mapper->toFirst();
244
245 const auto& font_for_money = _model->data(_model->index(OptionsModel::FontForMoney, 0), Qt::EditRole).value<OptionsModel::FontChoice>();
246 setFontChoice(ui->moneyFont, font_for_money);
247
249 }
250
251 /* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */
252
253 /* Main */
254 connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
255 connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::togglePruneWarning);
256 connect(ui->pruneSize, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
257 connect(ui->databaseCache, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
258 connect(ui->externalSignerPath, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
259 connect(ui->threadsScriptVerif, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
260 /* Wallet */
261 connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
262 /* Network */
263 connect(ui->allowIncoming, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
264 connect(ui->enableServer, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
265 connect(ui->connectSocks, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
266 connect(ui->connectSocksTor, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
267 /* Display */
268 connect(ui->lang, qOverload<>(&QValueComboBox::valueChanged), [this]{ showRestartWarning(); });
269 connect(ui->thirdPartyTxUrls, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
270}
271
273{
274 QWidget *tab_widget = nullptr;
275 if (tab == OptionsDialog::Tab::TAB_NETWORK) tab_widget = ui->tabNetwork;
276 if (tab == OptionsDialog::Tab::TAB_MAIN) tab_widget = ui->tabMain;
277 if (tab_widget && ui->tabWidget->currentWidget() != tab_widget) {
278 ui->tabWidget->setCurrentWidget(tab_widget);
279 }
280}
281
283{
284 /* Main */
285 mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
286 mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif);
287 mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache);
288 mapper->addMapping(ui->prune, OptionsModel::Prune);
289 mapper->addMapping(ui->pruneSize, OptionsModel::PruneSize);
290
291 /* Wallet */
292 mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
293 mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
294 mapper->addMapping(ui->subFeeFromAmount, OptionsModel::SubFeeFromAmount);
295 mapper->addMapping(ui->externalSignerPath, OptionsModel::ExternalSignerPath);
296 mapper->addMapping(ui->m_enable_psbt_controls, OptionsModel::EnablePSBTControls);
297
298 /* Network */
299 mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
300 mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
301 mapper->addMapping(ui->enableServer, OptionsModel::Server);
302
303 mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
304 mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);
305 mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort);
306
307 mapper->addMapping(ui->connectSocksTor, OptionsModel::ProxyUseTor);
308 mapper->addMapping(ui->proxyIpTor, OptionsModel::ProxyIPTor);
309 mapper->addMapping(ui->proxyPortTor, OptionsModel::ProxyPortTor);
310
311 /* Window */
312#ifndef Q_OS_MACOS
313 if (QSystemTrayIcon::isSystemTrayAvailable()) {
314 mapper->addMapping(ui->showTrayIcon, OptionsModel::ShowTrayIcon);
315 mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);
316 }
317 mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);
318#endif
319
320 /* Display */
321 mapper->addMapping(ui->lang, OptionsModel::Language);
322 mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
323 mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);
324}
325
327{
328 ui->okButton->setEnabled(fState);
329}
330
332{
333 if (model) {
334 // confirmation dialog
335 /*: Text explaining that the settings changed will not come into effect
336 until the client is restarted. */
337 QString reset_dialog_text = tr("Client restart required to activate changes.") + "<br><br>";
338 /*: Text explaining to the user that the client's current settings
339 will be backed up at a specific location. %1 is a stand-in
340 argument for the backup location's path. */
341 reset_dialog_text.append(tr("Current settings will be backed up at \"%1\".").arg(m_client_model->dataDir()) + "<br><br>");
342 /*: Text asking the user to confirm if they would like to proceed
343 with a client shutdown. */
344 reset_dialog_text.append(tr("Client will be shut down. Do you want to proceed?"));
345 //: Window title text of pop-up window shown when the user has chosen to reset options.
346 QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
347 reset_dialog_text, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
348
349 if (btnRetVal == QMessageBox::Cancel)
350 return;
351
352 /* reset all options and close GUI */
353 model->Reset();
354 close();
355 Q_EMIT quitOnReset();
356 }
357}
358
360{
361 QMessageBox config_msgbox(this);
362 config_msgbox.setIcon(QMessageBox::Information);
363 //: Window title text of pop-up box that allows opening up of configuration file.
364 config_msgbox.setWindowTitle(tr("Configuration options"));
365 /*: Explanatory text about the priority order of instructions considered by client.
366 The order from high to low being: command-line, configuration file, GUI settings. */
367 config_msgbox.setText(tr("The configuration file is used to specify advanced user options which override GUI settings. "
368 "Additionally, any command-line options will override this configuration file."));
369
370 QPushButton* open_button = config_msgbox.addButton(tr("Continue"), QMessageBox::ActionRole);
371 config_msgbox.addButton(tr("Cancel"), QMessageBox::RejectRole);
372 open_button->setDefault(true);
373
374 config_msgbox.exec();
375
376 if (config_msgbox.clickedButton() != open_button) return;
377
378 /* show an error if there was some problem opening the file */
380 QMessageBox::critical(this, tr("Error"), tr("The configuration file could not be opened."));
381}
382
384{
385 model->setData(model->index(OptionsModel::FontForMoney, 0), ui->moneyFont->itemData(ui->moneyFont->currentIndex()));
386
387 mapper->submit();
388 accept();
390}
391
393{
394 reject();
395}
396
398{
399 if (state == Qt::Checked) {
400 ui->minimizeToTray->setEnabled(true);
401 } else {
402 ui->minimizeToTray->setChecked(false);
403 ui->minimizeToTray->setEnabled(false);
404 }
405}
406
408{
409 ui->pruneWarning->setVisible(!ui->pruneWarning->isVisible());
410}
411
413{
414 ui->statusLabel->setStyleSheet("QLabel { color: red; }");
415
416 if(fPersistent)
417 {
418 ui->statusLabel->setText(tr("Client restart required to activate changes."));
419 }
420 else
421 {
422 ui->statusLabel->setText(tr("This change would require a client restart."));
423 // clear non-persistent status label after 10 seconds
424 // Todo: should perhaps be a class attribute, if we extend the use of statusLabel
425 QTimer::singleShot(10s, this, &OptionsDialog::clearStatusLabel);
426 }
427}
428
430{
431 ui->statusLabel->clear();
432 if (model && model->isRestartRequired()) {
433 showRestartWarning(true);
434 }
435}
436
438{
439 QValidatedLineEdit *pUiProxyIp = ui->proxyIp;
440 QValidatedLineEdit *otherProxyWidget = (pUiProxyIp == ui->proxyIpTor) ? ui->proxyIp : ui->proxyIpTor;
441 if (pUiProxyIp->isValid() && (!ui->proxyPort->isEnabled() || ui->proxyPort->text().toInt() > 0) && (!ui->proxyPortTor->isEnabled() || ui->proxyPortTor->text().toInt() > 0))
442 {
443 setOkButtonState(otherProxyWidget->isValid()); //only enable ok button if both proxies are valid
445 }
446 else
447 {
448 setOkButtonState(false);
449 ui->statusLabel->setStyleSheet("QLabel { color: red; }");
450 ui->statusLabel->setText(tr("The supplied proxy address is invalid."));
451 }
452}
453
455{
456 std::string proxyIpText{ui->proxyIp->text().toStdString()};
457 if (!IsUnixSocketPath(proxyIpText)) {
458 const std::optional<CNetAddr> ui_proxy_netaddr{LookupHost(proxyIpText, /*fAllowLookup=*/false)};
459 const CService ui_proxy{ui_proxy_netaddr.value_or(CNetAddr{}), ui->proxyPort->text().toUShort()};
460 proxyIpText = ui_proxy.ToStringAddrPort();
461 }
462
463 Proxy proxy;
464 bool has_proxy;
465
466 has_proxy = model->node().getProxy(NET_IPV4, proxy);
467 ui->proxyReachIPv4->setChecked(has_proxy && proxy.ToString() == proxyIpText);
468
469 has_proxy = model->node().getProxy(NET_IPV6, proxy);
470 ui->proxyReachIPv6->setChecked(has_proxy && proxy.ToString() == proxyIpText);
471
472 has_proxy = model->node().getProxy(NET_ONION, proxy);
473 ui->proxyReachTor->setChecked(has_proxy && proxy.ToString() == proxyIpText);
474}
475
477QValidator(parent)
478{
479}
480
481QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const
482{
483 Q_UNUSED(pos);
484 uint16_t port{0};
485 std::string hostname;
486 if (!SplitHostPort(input.toStdString(), port, hostname) || port != 0) return QValidator::Invalid;
487
488 CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT));
489 Proxy addrProxy = Proxy(serv, true);
490 if (addrProxy.IsValid())
491 return QValidator::Acceptable;
492
493 return QValidator::Invalid;
494}
if(!SetupNetworking())
Bitcoin unit definitions.
Definition: bitcoinunits.h:33
Network address.
Definition: netaddress.h:112
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:531
Model for Bitcoin network client.
Definition: clientmodel.h:57
QString dataDir() const
Preferences dialog.
Definition: optionsdialog.h:37
void setModel(OptionsModel *model)
OptionsModel * model
Definition: optionsdialog.h:78
void setCurrentTab(OptionsDialog::Tab tab)
void on_showTrayIcon_stateChanged(int state)
void on_okButton_clicked()
void on_openBitcoinConfButton_clicked()
void updateDefaultProxyNets()
void updateProxyValidationState()
void togglePruneWarning(bool enabled)
void showRestartWarning(bool fPersistent=false)
ClientModel * m_client_model
Definition: optionsdialog.h:77
void on_resetButton_clicked()
Ui::OptionsDialog * ui
Definition: optionsdialog.h:76
void quitOnReset()
OptionsDialog(QWidget *parent, bool enableWallet)
QDataWidgetMapper * mapper
Definition: optionsdialog.h:79
void clearStatusLabel()
void setClientModel(ClientModel *client_model)
void on_cancelButton_clicked()
void setOkButtonState(bool fState)
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:43
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
std::variant< FontChoiceAbstract, QFont > FontChoice
Definition: optionsmodel.h:84
bool isRestartRequired() const
interfaces::Node & node() const
Definition: optionsmodel.h:121
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
const QString & getOverriddenByCommandLine()
Definition: optionsmodel.h:109
static QFont getFontForChoice(const FontChoice &fc)
Proxy address widget validator, checks for a valid proxy address.
Definition: optionsdialog.h:26
ProxyAddressValidator(QObject *parent)
State validate(QString &input, int &pos) const override
Definition: netbase.h:59
std::string ToString() const
Definition: netbase.h:82
bool IsValid() const
Definition: netbase.h:70
Line edit that can be marked as "invalid" to show input validation feedback.
void validationDidChange(QValidatedLineEdit *validatedLineEdit)
void valueChanged()
virtual bool getProxy(Network net, Proxy &proxy_info)=0
Get proxy.
int GetNumCores()
Return the number of cores available on the current system.
Definition: system.cpp:103
static constexpr uint64_t GB_BYTES
Definition: guiconstants.h:58
Utility functions used by the Bitcoin Qt UI.
Definition: bitcoingui.h:58
bool openBitcoinConf()
Definition: guiutil.cpp:445
QFont fixedPitchFont(bool use_embedded_font)
Definition: guiutil.cpp:100
void handleCloseWindowShortcut(QWidget *w)
Definition: guiutil.cpp:431
constexpr auto dialog_flags
Definition: guiutil.h:60
@ NET_ONION
TOR (v2 or v3)
Definition: netaddress.h:43
@ NET_IPV6
IPv6.
Definition: netaddress.h:40
@ NET_IPV4
IPv4.
Definition: netaddress.h:37
std::vector< CNetAddr > LookupHost(const std::string &name, unsigned int nMaxSolutions, bool fAllowLookup, DNSLookupFn dns_lookup_function)
Resolve a host string to its corresponding network addresses.
Definition: netbase.cpp:177
bool IsUnixSocketPath(const std::string &name)
Check if a string is a valid UNIX domain socket path.
Definition: netbase.cpp:230
CService LookupNumeric(const std::string &name, uint16_t portDefault, DNSLookupFn dns_lookup_function)
Resolve a service string with a numeric IP to its first corresponding service.
Definition: netbase.cpp:220
static constexpr size_t MIN_DB_CACHE
min. -dbcache (bytes)
Definition: caches.h:16
void setupFontOptions(QComboBox *cb, QLabel *preview)
int setFontChoice(QComboBox *cb, const OptionsModel::FontChoice &fc)
static constexpr uint16_t DEFAULT_GUI_PROXY_PORT
Definition: optionsmodel.h:24
bool SplitHostPort(std::string_view in, uint16_t &portOut, std::string &hostOut)
Splits socket address string into host string and port value.
static constexpr int MAX_SCRIPTCHECK_THREADS
Maximum number of dedicated script-checking threads allowed.
Definition: validation.h:82
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
Definition: validation.h:79