Bitcoin full node and query server

Apr 8, 2024

View in context in the libbitcoin Slack #general mirror.

evoskuil04:26
std::vector<size_t> malleable(size_t set) NOEXCEPT
{
    std::vector<size_t> out{};
    for (auto copy = one; copy <= to_half(set); copy *= two)
    {
        for (auto width = set - copy,
            depth = one; depth <= copy; depth *= two,
            width = to_half(width))
        {
            if (is_odd(width))
            {
                if ((depth == copy) && !is_one(width))
                    out.push_back(copy);
                break;
            }
        }
    }

    return out;
}