mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
refactor: Use designated initializer
Block was recently touched (e2d1f84858
) and the codebase recently switched to C++20 which allows this to improve robustness.
This commit is contained in:
parent
bd5d1688b4
commit
e233ec036d
1 changed files with 14 additions and 14 deletions
|
@ -118,20 +118,20 @@ std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(int n_candida
|
|||
candidates.reserve(n_candidates);
|
||||
for (int id = 0; id < n_candidates; ++id) {
|
||||
candidates.push_back({
|
||||
/*id=*/id,
|
||||
/*m_connected=*/std::chrono::seconds{random_context.randrange(100)},
|
||||
/*m_min_ping_time=*/std::chrono::microseconds{random_context.randrange(100)},
|
||||
/*m_last_block_time=*/std::chrono::seconds{random_context.randrange(100)},
|
||||
/*m_last_tx_time=*/std::chrono::seconds{random_context.randrange(100)},
|
||||
/*fRelevantServices=*/random_context.randbool(),
|
||||
/*m_relay_txs=*/random_context.randbool(),
|
||||
/*fBloomFilter=*/random_context.randbool(),
|
||||
/*nKeyedNetGroup=*/random_context.randrange(100u),
|
||||
/*prefer_evict=*/random_context.randbool(),
|
||||
/*m_is_local=*/random_context.randbool(),
|
||||
/*m_network=*/ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())],
|
||||
/*m_noban=*/false,
|
||||
/*m_conn_type=*/ConnectionType::INBOUND,
|
||||
.id=id,
|
||||
.m_connected=std::chrono::seconds{random_context.randrange(100)},
|
||||
.m_min_ping_time=std::chrono::microseconds{random_context.randrange(100)},
|
||||
.m_last_block_time=std::chrono::seconds{random_context.randrange(100)},
|
||||
.m_last_tx_time=std::chrono::seconds{random_context.randrange(100)},
|
||||
.fRelevantServices=random_context.randbool(),
|
||||
.m_relay_txs=random_context.randbool(),
|
||||
.fBloomFilter=random_context.randbool(),
|
||||
.nKeyedNetGroup=random_context.randrange(100u),
|
||||
.prefer_evict=random_context.randbool(),
|
||||
.m_is_local=random_context.randbool(),
|
||||
.m_network=ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())],
|
||||
.m_noban=false,
|
||||
.m_conn_type=ConnectionType::INBOUND,
|
||||
});
|
||||
}
|
||||
return candidates;
|
||||
|
|
Loading…
Add table
Reference in a new issue