Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-sample block rate for bootstrap connections #2823

Conversation

guilhermelawless
Copy link
Contributor

@guilhermelawless guilhermelawless commented Jun 18, 2020

This solves a Debug assert on msvc: strict weak ordering not being satisfied in bootstrap_connections::populate_connections due to block_rate_cmp

// FUNCTION TEMPLATE _Debug_lt_pred
template <class _Pr, class _Ty1, class _Ty2,
    enable_if_t<is_same_v<_Remove_cvref_t<_Ty1>, _Remove_cvref_t<_Ty2>>, int> = 0>
constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Right) noexcept(
    noexcept(_Pred(_Left, _Right)) && noexcept(_Pred(_Right, _Left))) {
    // test if _Pred(_Left, _Right) and _Pred is strict weak ordering, when the arguments are the cv-same-type
    const auto _Result = static_cast<bool>(_Pred(_Left, _Right));
    if (_Result) {
        _STL_VERIFY(!_Pred(_Right, _Left), "invalid comparator");
    }

    return _Result;
}

This solves a Debug assert on msvc: strict weak ordering not being satisfied in `bootstrap_connections::populate_connections` due to `block_rate_cmp`
@guilhermelawless guilhermelawless added this to the V22.0 milestone Jun 18, 2020
@guilhermelawless guilhermelawless self-assigned this Jun 18, 2020
@guilhermelawless guilhermelawless merged commit a09b822 into nanocurrency:develop Jun 22, 2020
@guilhermelawless guilhermelawless deleted the bootstrap/populate-connections-assert branch June 22, 2020 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants