Skip to content

Commit 7d9f3c7

Browse files
committed
qml: expose assumed blockchain and chainstate size as to qml
1 parent 0c945f0 commit 7d9f3c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/qml/chainmodel.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef BITCOIN_QML_CHAINMODEL_H
66
#define BITCOIN_QML_CHAINMODEL_H
77

8+
#include <chainparams.h>
89
#include <interfaces/chain.h>
910

1011
#include <QObject>
@@ -23,13 +24,17 @@ class ChainModel : public QObject
2324
{
2425
Q_OBJECT
2526
Q_PROPERTY(QString currentNetworkName READ currentNetworkName WRITE setCurrentNetworkName NOTIFY currentNetworkNameChanged)
27+
Q_PROPERTY(quint64 assumedBlockchainSize READ assumedBlockchainSize CONSTANT)
28+
Q_PROPERTY(quint64 assumedChainstateSize READ assumedChainstateSize CONSTANT)
2629
Q_PROPERTY(QVariantList timeRatioList READ timeRatioList NOTIFY timeRatioListChanged)
2730

2831
public:
2932
explicit ChainModel(interfaces::Chain& chain);
3033

3134
QString currentNetworkName() const { return m_current_network_name; };
3235
void setCurrentNetworkName(QString network_name);
36+
quint64 assumedBlockchainSize() const { return m_assumed_blockchain_size; };
37+
quint64 assumedChainstateSize() const { return m_assumed_chainstate_size; };
3338
QVariantList timeRatioList() const { return m_time_ratio_list; };
3439

3540
int timestampAtMeridian();
@@ -46,6 +51,8 @@ public Q_SLOTS:
4651

4752
private:
4853
QString m_current_network_name;
54+
quint64 m_assumed_blockchain_size{ Params().AssumedBlockchainSize() };
55+
quint64 m_assumed_chainstate_size{ Params().AssumedChainStateSize() };
4956
/* time_ratio: Ratio between the time at which an event
5057
* happened and 12 hours. So, for example, if a block is
5158
* found at 4 am or pm, the time_ratio would be 0.3.

0 commit comments

Comments
 (0)