1
0
Fork 0
forked from lthn/blockchain

disabled market, fixed p2p api

This commit is contained in:
crypro.zoidberg 2019-01-17 13:50:51 +03:00
parent ba2af056fd
commit 2c74d4a6e7
4 changed files with 8 additions and 3 deletions

View file

@ -125,6 +125,7 @@ namespace epee
template<class stl_container, class t_storage>
static bool serialize_stl_container_pod_val_as_blob(const stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
static_assert(std::is_trivial<stl_container::value_type>::value, "Item supposed to be 'trivial'(trivially copyable)");
if(!container.size()) return true;
std::string mb;
mb.resize(sizeof(typename stl_container::value_type)*container.size());
@ -140,6 +141,7 @@ namespace epee
template<class stl_container, class t_storage>
static bool unserialize_stl_container_pod_val_as_blob(stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname)
{
static_assert(std::is_trivial<stl_container::value_type>::value, "Item supposed to be 'trivial'(trivially copyable)");
container.clear();
std::string buff;
bool res = stg.get_value(pname, buff, hparent_section);

View file

@ -160,7 +160,7 @@ int main(int argc, char* argv[])
ccore.set_currency_protocol(&cprotocol);
daemon_cmmands_handler dch(p2psrv, rpc_server);
tools::miniupnp_helper upnp_helper;
ccore.get_blockchain_storage().get_attachment_services_manager().add_service(&offers_service);
//ccore.get_blockchain_storage().get_attachment_services_manager().add_service(&offers_service);
if (command_line::get_arg(vm, command_line::arg_show_rpc_autodoc))
{

View file

@ -1061,7 +1061,8 @@ namespace nodetool
ce.time_started = cntxt.m_started;
ce.last_recv = cntxt.m_last_recv;
ce.last_send = cntxt.m_last_send;
ce.version = cntxt.m_remote_version;
std::strncpy(ce.version, cntxt.m_remote_version.c_str(), std::min(sizeof(ce.version), cntxt.m_remote_version.size()));
ce.version[sizeof(ce.version) - 1] = 0; //null terminating just to be sure
rsp.connections_list.push_back(ce);
return true;
});

View file

@ -33,6 +33,8 @@ namespace nodetool
time_t last_seen;
};
#define P2P_CONNECTION_ENTRY_VERSION_MAX_SIZE 50
struct connection_entry
{
net_address adr;
@ -41,7 +43,7 @@ namespace nodetool
uint64_t time_started;
uint64_t last_recv;
uint64_t last_send;
std::string version;
char version[P2P_CONNECTION_ENTRY_VERSION_MAX_SIZE];
};
#pragma pack(pop)