Skip to content

Commit 343f83d

Browse files
committed
qt, refactor: Use member initializers in TransactionStatus
1 parent 66d58ad commit 343f83d

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/qt/transactionrecord.h

+6-12
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ struct WalletTxStatus;
2020

2121
/** UI model for transaction status. The transaction status is the part of a transaction that will change over time.
2222
*/
23-
class TransactionStatus
24-
{
25-
public:
26-
TransactionStatus() : countsForBalance(false), sortKey(""),
27-
matures_in(0), status(Unconfirmed), depth(0), open_for(0)
28-
{ }
29-
23+
struct TransactionStatus {
3024
enum Status {
3125
Confirmed, /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/
3226
/// Normal (sent/received) transactions
@@ -40,25 +34,25 @@ class TransactionStatus
4034
};
4135

4236
/// Transaction counts towards available balance
43-
bool countsForBalance;
37+
bool countsForBalance{false};
4438
/// Sorting key based on status
4539
std::string sortKey;
4640

4741
/** @name Generated (mined) transactions
4842
@{*/
49-
int matures_in;
43+
int matures_in{0};
5044
/**@}*/
5145

5246
/** @name Reported status
5347
@{*/
54-
Status status;
55-
qint64 depth;
48+
Status status{Unconfirmed};
49+
qint64 depth{0};
5650
/**@}*/
5751

5852
/** Current block hash (to know whether cached status is still valid) */
5953
uint256 m_cur_block_hash{};
6054

61-
bool needsUpdate;
55+
bool needsUpdate{false};
6256
};
6357

6458
/** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has

0 commit comments

Comments
 (0)