Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/protocols/protocol_block_in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,13 @@ get_blocks protocol_block_in::create_get_inventory(
get_data protocol_block_in::create_get_data(
const inventory& message) const NOEXCEPT
{
// clang emplace_back bug (no matching constructor), using push_back.
// bip144: get_data uses witness constant but inventory does not.

get_data getter{};
getter.items.reserve(message.count(type_id::block));
for (const messages::inventory_item& item: message.items)
if ((item.type == type_id::block) && !archive().is_block(item.hash))
getter.items.push_back({ block_type_, item.hash });
getter.items.emplace_back(block_type_, item.hash);

getter.items.shrink_to_fit();
return getter;
Expand Down
3 changes: 1 addition & 2 deletions src/protocols/protocol_block_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,9 @@ get_data protocol_block_in_31800::create_get_data(
data.items.reserve(map.size());

// bip144: get_data uses witness constant but inventory does not.
// clang emplace_back bug (no matching constructor), using push_back.
std::for_each(map.pos_begin(), map.pos_end(), [&](const auto& item) NOEXCEPT
{
data.items.push_back({ block_type_, item.hash });
data.items.emplace_back(block_type_, item.hash);
});

return data;
Expand Down
Loading