diff --git a/libi2pd_client/I2CP.cpp b/libi2pd_client/I2CP.cpp index 7552c6c5..43c891d5 100644 --- a/libi2pd_client/I2CP.cpp +++ b/libi2pd_client/I2CP.cpp @@ -146,7 +146,7 @@ namespace client void I2CPDestination::SendMsgTo (const uint8_t * payload, size_t len, const i2p::data::IdentHash& ident, uint32_t nonce) { - auto msg = NewI2NPMessage (); + auto msg = m_I2NPMsgsPool.AcquireSharedMt (); uint8_t * buf = msg->GetPayload (); htobe32buf (buf, len); memcpy (buf + 4, payload, len); diff --git a/libi2pd_client/I2CP.h b/libi2pd_client/I2CP.h index 5495be7a..3c5773ad 100644 --- a/libi2pd_client/I2CP.h +++ b/libi2pd_client/I2CP.h @@ -122,6 +122,7 @@ namespace client uint64_t m_LeaseSetExpirationTime; bool m_IsCreatingLeaseSet; boost::asio::deadline_timer m_LeaseSetCreationTimer; + i2p::util::MemoryPoolMt > m_I2NPMsgsPool; }; class RunnableI2CPDestination: private i2p::util::RunnableService, public I2CPDestination