mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
NPL message refactor. (#132)
* Implemented feeding and broadcasting npl messages from the contract execution in real-time. * Replaced npl pipe with domain sockets. * Refactored npl read and write in nodejs echo contract
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "../pchheader.hpp"
|
||||
#include "../conf.hpp"
|
||||
#include "../consensus.hpp"
|
||||
#include "../crypto.hpp"
|
||||
#include "../util.hpp"
|
||||
#include "../hplog.hpp"
|
||||
@@ -133,14 +134,16 @@ namespace p2p
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::scoped_lock<std::mutex> lock(ctx.collected_msgs.npl_messages_mutex); // Insert npl message with lock.
|
||||
|
||||
const p2pmsg::Npl_Message *npl_p2p_msg = content->message_as_Npl_Message();
|
||||
npl_message msg;
|
||||
msg.data = msg::fbuf::flatbuff_bytes_to_sv(npl_p2p_msg->data());
|
||||
msg.pubkey = msg::fbuf::flatbuff_bytes_to_sv(container->pubkey());
|
||||
msg.lcl = msg::fbuf::flatbuff_bytes_to_sv(container->lcl());
|
||||
ctx.collected_msgs.npl_messages.push_back(std::move(msg));
|
||||
|
||||
if (!consensus::push_npl_message(msg))
|
||||
{
|
||||
LOG_DEBUG << "NPL message enqueue failure. " << session.uniqueid.substr(0, 10);
|
||||
}
|
||||
}
|
||||
else if (content_message_type == p2pmsg::Message_State_Request_Message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user