mirror of
https://github.com/monero-project/monero.git
synced 2025-12-21 23:00:49 -08:00
epee: better network buffer data structure
avoids pointless allocs and memcpy
This commit is contained in:
@@ -155,7 +155,7 @@ namespace cryptonote
|
||||
std::string blob;
|
||||
epee::serialization::store_t_to_binary(arg, blob);
|
||||
//handler_response_blocks_now(blob.size()); // XXX
|
||||
return m_p2p->invoke_notify_to_peer(t_parameter::ID, blob, context);
|
||||
return m_p2p->invoke_notify_to_peer(t_parameter::ID, epee::strspan<uint8_t>(blob), context);
|
||||
}
|
||||
|
||||
template<class t_parameter>
|
||||
@@ -164,7 +164,7 @@ namespace cryptonote
|
||||
LOG_PRINT_L2("[" << epee::net_utils::print_connection_context_short(exclude_context) << "] post relay " << typeid(t_parameter).name() << " -->");
|
||||
std::string arg_buff;
|
||||
epee::serialization::store_t_to_binary(arg, arg_buff);
|
||||
return m_p2p->relay_notify_to_all(t_parameter::ID, arg_buff, exclude_context);
|
||||
return m_p2p->relay_notify_to_all(t_parameter::ID, epee::strspan<uint8_t>(arg_buff), exclude_context);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user