mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Refactored consensus into 3 rounds. (#144)
* Refactored consensus into 3 stages and removed stage 0. * Consensus threshold calculation improvements. * Refactored candidate user input processing. * Renamed proposal sent timestamp field. * Introduced comm_session display name.
This commit is contained in:
@@ -142,23 +142,19 @@ namespace read_req
|
||||
if (!user_buf_itr->second.outputs.empty())
|
||||
{
|
||||
// Find the user session by user pubkey.
|
||||
const auto sess_itr = usr::ctx.sessionids.find(user_buf_itr->first);
|
||||
if (sess_itr != usr::ctx.sessionids.end()) // match found
|
||||
const auto user_itr = usr::ctx.users.find(user_buf_itr->first);
|
||||
if (user_itr != usr::ctx.users.end()) // match found
|
||||
{
|
||||
const auto user_itr = usr::ctx.users.find(sess_itr->second); // sess_itr->second is the session id.
|
||||
if (user_itr != usr::ctx.users.end()) // match found
|
||||
const usr::connected_user &user = user_itr->second;
|
||||
msg::usrmsg::usrmsg_parser parser(user.protocol);
|
||||
for (sc::contract_output &output : user_buf_itr->second.outputs)
|
||||
{
|
||||
const usr::connected_user &user = user_itr->second;
|
||||
msg::usrmsg::usrmsg_parser parser(user.protocol);
|
||||
for (sc::contract_output &output : user_buf_itr->second.outputs)
|
||||
{
|
||||
std::vector<uint8_t> msg;
|
||||
parser.create_contract_read_response_container(msg, output.message);
|
||||
user.session.send(msg);
|
||||
output.message.clear();
|
||||
}
|
||||
user_buf_itr->second.outputs.clear();
|
||||
std::vector<uint8_t> msg;
|
||||
parser.create_contract_read_response_container(msg, output.message);
|
||||
user.session.send(msg);
|
||||
output.message.clear();
|
||||
}
|
||||
user_buf_itr->second.outputs.clear();
|
||||
}
|
||||
}
|
||||
LOG_DEBUG << "Read request contract execution ended.";
|
||||
|
||||
Reference in New Issue
Block a user