Skip to content

Commit e516539

Browse files
committed
Merge bitcoin/bitcoin#30397: refactor: Use designated initializer in test/util/net.cpp
e233ec0 refactor: Use designated initializer (Hodlinator) Pull request description: Block was recently touched (e2d1f84) and the codebase recently switched to C++20 which allows this to improve robustness. Follow-up suggested in bitcoin/bitcoin#29625 (comment) ACKs for top commit: maflcko: ACK e233ec0 Tree-SHA512: ce3a18f513421e923710a43c8f97db1badb7ff5c6bdbfd62d9543312d2225731db5c14bef16feb47c43b84fad4dc24485086634b680feba422d2b7b363e13fa6
2 parents e5a5497 + e233ec0 commit e516539

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/test/util/net.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,20 @@ std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(int n_candida
118118
candidates.reserve(n_candidates);
119119
for (int id = 0; id < n_candidates; ++id) {
120120
candidates.push_back({
121-
/*id=*/id,
122-
/*m_connected=*/std::chrono::seconds{random_context.randrange(100)},
123-
/*m_min_ping_time=*/std::chrono::microseconds{random_context.randrange(100)},
124-
/*m_last_block_time=*/std::chrono::seconds{random_context.randrange(100)},
125-
/*m_last_tx_time=*/std::chrono::seconds{random_context.randrange(100)},
126-
/*fRelevantServices=*/random_context.randbool(),
127-
/*m_relay_txs=*/random_context.randbool(),
128-
/*fBloomFilter=*/random_context.randbool(),
129-
/*nKeyedNetGroup=*/random_context.randrange(100u),
130-
/*prefer_evict=*/random_context.randbool(),
131-
/*m_is_local=*/random_context.randbool(),
132-
/*m_network=*/ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())],
133-
/*m_noban=*/false,
134-
/*m_conn_type=*/ConnectionType::INBOUND,
121+
.id=id,
122+
.m_connected=std::chrono::seconds{random_context.randrange(100)},
123+
.m_min_ping_time=std::chrono::microseconds{random_context.randrange(100)},
124+
.m_last_block_time=std::chrono::seconds{random_context.randrange(100)},
125+
.m_last_tx_time=std::chrono::seconds{random_context.randrange(100)},
126+
.fRelevantServices=random_context.randbool(),
127+
.m_relay_txs=random_context.randbool(),
128+
.fBloomFilter=random_context.randbool(),
129+
.nKeyedNetGroup=random_context.randrange(100u),
130+
.prefer_evict=random_context.randbool(),
131+
.m_is_local=random_context.randbool(),
132+
.m_network=ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())],
133+
.m_noban=false,
134+
.m_conn_type=ConnectionType::INBOUND,
135135
});
136136
}
137137
return candidates;

0 commit comments

Comments
 (0)