Skip to content

Commit 4eace03

Browse files
committed
qml: Expose minimum and maximum valid Script Verif Threads values
1 parent 6440078 commit 4eace03

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/qml/options_model.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#define BITCOIN_QML_OPTIONS_MODEL_H
77

88
#include <util/settings.h>
9+
#include <util/system.h>
10+
#include <validation.h>
911

1012
#include <QObject>
1113

@@ -19,6 +21,8 @@ class OptionsQmlModel : public QObject
1921
Q_OBJECT
2022
Q_PROPERTY(int dbcacheSizeMiB READ dbcacheSizeMiB WRITE setDbcacheSizeMiB NOTIFY dbcacheSizeMiBChanged)
2123
Q_PROPERTY(bool listen READ listen WRITE setListen NOTIFY listenChanged)
24+
Q_PROPERTY(int maxScriptThreads READ maxScriptThreads CONSTANT)
25+
Q_PROPERTY(int minScriptThreads READ minScriptThreads CONSTANT)
2226
Q_PROPERTY(bool natpmp READ natpmp WRITE setNatpmp NOTIFY natpmpChanged)
2327
Q_PROPERTY(bool prune READ prune WRITE setPrune NOTIFY pruneChanged)
2428
Q_PROPERTY(int pruneSizeGB READ pruneSizeGB WRITE setPruneSizeGB NOTIFY pruneSizeGBChanged)
@@ -33,6 +37,8 @@ class OptionsQmlModel : public QObject
3337
void setDbcacheSizeMiB(int new_dbcache_size_mib);
3438
bool listen() const { return m_listen; }
3539
void setListen(bool new_listen);
40+
int maxScriptThreads() const { return m_max_script_threads; }
41+
int minScriptThreads() const { return m_min_script_threads; }
3642
bool natpmp() const { return m_natpmp; }
3743
void setNatpmp(bool new_natpmp);
3844
bool prune() const { return m_prune; }
@@ -62,6 +68,8 @@ class OptionsQmlModel : public QObject
6268
// Properties that are exposed to QML.
6369
int m_dbcache_size_mib;
6470
bool m_listen;
71+
const int m_max_script_threads{MAX_SCRIPTCHECK_THREADS};
72+
const int m_min_script_threads{-GetNumCores()};
6573
bool m_natpmp;
6674
bool m_prune;
6775
int m_prune_size_gb;

0 commit comments

Comments
 (0)