@@ -25,6 +25,8 @@ class NodeModel : public QObject
25
25
{
26
26
Q_OBJECT
27
27
Q_PROPERTY (int blockTipHeight READ blockTipHeight NOTIFY blockTipHeightChanged)
28
+ Q_PROPERTY (int numOutboundPeers READ numOutboundPeers NOTIFY numOutboundPeersChanged)
29
+ Q_PROPERTY (int maxNumOutboundPeers READ maxNumOutboundPeers CONSTANT)
28
30
Q_PROPERTY (int remainingSyncTime READ remainingSyncTime NOTIFY remainingSyncTimeChanged)
29
31
Q_PROPERTY (double verificationProgress READ verificationProgress NOTIFY verificationProgressChanged)
30
32
Q_PROPERTY (bool pause READ pause WRITE setPause NOTIFY pauseChanged)
@@ -34,6 +36,9 @@ class NodeModel : public QObject
34
36
35
37
int blockTipHeight () const { return m_block_tip_height; }
36
38
void setBlockTipHeight (int new_height);
39
+ int numOutboundPeers () const { return m_num_outbound_peers; }
40
+ void setNumOutboundPeers (int new_num);
41
+ int maxNumOutboundPeers () const { return m_max_num_outbound_peers; }
37
42
int remainingSyncTime () const { return m_remaining_sync_time; }
38
43
void setRemainingSyncTime (double new_progress);
39
44
double verificationProgress () const { return m_verification_progress; }
@@ -51,6 +56,7 @@ public Q_SLOTS:
51
56
52
57
Q_SIGNALS:
53
58
void blockTipHeightChanged ();
59
+ void numOutboundPeersChanged ();
54
60
void remainingSyncTimeChanged ();
55
61
void requestedInitialize ();
56
62
void requestedShutdown ();
@@ -66,6 +72,8 @@ public Q_SLOTS:
66
72
private:
67
73
// Properties that are exposed to QML.
68
74
int m_block_tip_height{0 };
75
+ int m_num_outbound_peers{0 };
76
+ static constexpr int m_max_num_outbound_peers{MAX_OUTBOUND_FULL_RELAY_CONNECTIONS + MAX_BLOCK_RELAY_ONLY_CONNECTIONS};
69
77
int m_remaining_sync_time{0 };
70
78
double m_verification_progress{0.0 };
71
79
bool m_pause{false };
@@ -76,8 +84,10 @@ public Q_SLOTS:
76
84
77
85
interfaces::Node& m_node;
78
86
std::unique_ptr<interfaces::Handler> m_handler_notify_block_tip;
87
+ std::unique_ptr<interfaces::Handler> m_handler_notify_num_peers_changed;
79
88
80
89
void ConnectToBlockTipSignal ();
90
+ void ConnectToNumConnectionsChangedSignal ();
81
91
};
82
92
83
93
#endif // BITCOIN_QML_NODEMODEL_H
0 commit comments