aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h
index ee3a67198..7093f7826 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h
@@ -37,6 +37,7 @@
#include <boost/program_options/variables_map.hpp>
#include <string>
+#include "byte_slice.h"
#include "math_helper.h"
#include "storages/levin_abstract_invoke2.h"
#include "warnings.h"
@@ -100,7 +101,7 @@ namespace cryptonote
void set_p2p_endpoint(nodetool::i_p2p_endpoint<connection_context>* p2p);
//bool process_handshake_data(const blobdata& data, cryptonote_connection_context& context);
bool process_payload_sync_data(const CORE_SYNC_DATA& hshd, cryptonote_connection_context& context, bool is_inital);
- bool get_payload_sync_data(blobdata& data);
+ bool get_payload_sync_data(epee::byte_slice& data);
bool get_payload_sync_data(CORE_SYNC_DATA& hshd);
bool on_callback(cryptonote_connection_context& context);
t_core& get_core(){return m_core;}
@@ -191,10 +192,10 @@ namespace cryptonote
bool post_notify(typename t_parameter::request& arg, cryptonote_connection_context& context)
{
LOG_PRINT_L2("[" << epee::net_utils::print_connection_context_short(context) << "] post " << typeid(t_parameter).name() << " -->");
- std::string blob;
- epee::serialization::store_t_to_binary(arg, blob);
+ epee::byte_slice blob;
+ epee::serialization::store_t_to_binary(arg, blob, 256 * 1024); // optimize for block responses
//handler_response_blocks_now(blob.size()); // XXX
- return m_p2p->invoke_notify_to_peer(t_parameter::ID, epee::strspan<uint8_t>(blob), context);
+ return m_p2p->invoke_notify_to_peer(t_parameter::ID, epee::to_span(blob), context);
}
};