Skip to content

Commit

Permalink
GH-376 Simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jul 23, 2024
1 parent 19a9ea8 commit 973a452
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libraries/chain/finality/qc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ std::optional<qc_sig_t> open_qc_sig_t::get_best_qc() const {

// Both received_qc_sig and qc_sig_from_open have value. Compare them and select a better one.
// Strong beats weak. Tie-break by received_qc_sig, strong beats weak
bool use_received_qc_sig = received_qc_sig->is_strong() || (received_qc_sig->is_weak() && qc_sig_from_open.is_weak());
if (use_received_qc_sig) {
if (received_qc_sig->is_strong() || qc_sig_from_open.is_weak()) {
return std::optional{qc_sig_t{ *received_qc_sig }};
}
return std::optional{qc_sig_t{ std::move(qc_sig_from_open) }};
Expand Down

0 comments on commit 973a452

Please sign in to comment.