send localrc, receive as remoterc

pull/2228/head
dr7ana 5 months ago
parent 3c521c4923
commit f812d5471b

@ -14,7 +14,7 @@ namespace llarp
oxenc::bt_list_consumer btlc{buf};
while (not btlc.is_finished())
emplace(btlc.consume_dict_consumer());
emplace(btlc.consume_dict_data());
}
catch (...)
{

@ -1,6 +1,7 @@
#pragma once
#include "common.hpp"
#include <llarp/util/logging/buffer.hpp>
namespace llarp
{
@ -39,10 +40,11 @@ namespace llarp
{
// the LocalRC is converted to a RemoteRC type to send to the bootstrap seed
inline static std::string
serialize(const RemoteRC& local_rc, size_t quantity)
serialize(const LocalRC& local_rc, size_t quantity)
{
oxenc::bt_dict_producer btdp;
btdp.append_encoded("local", local_rc.view());
btdp.append_encoded("local", oxen::quic::to_sv(local_rc.view()));
log::critical(logcat, "Serializing localRC: {}", buffer_printer{local_rc.view()});
btdp.append("quantity", quantity);
return std::move(btdp).str();
}

@ -408,7 +408,7 @@ namespace llarp
std::set<RemoteRC> rcs;
while (not btlc.is_finished())
rcs.emplace(btlc.consume_dict_consumer());
rcs.emplace(btlc.consume_dict_data());
// if process_fetched_rcs returns false, then the trust model rejected the fetched RC's
fetch_rcs_result(initial, not ingest_fetched_rcs(std::move(rcs), timestamp));
@ -672,7 +672,7 @@ namespace llarp
_router.link_manager().fetch_bootstrap_rcs(
_bootstraps->current(),
BootstrapFetchMessage::serialize(
_router.router_contact.to_remote(), BOOTSTRAP_SOURCE_COUNT),
_router.router_contact, BOOTSTRAP_SOURCE_COUNT),
[this](oxen::quic::message m) mutable {
if (not m)
{
@ -698,7 +698,7 @@ namespace llarp
while (not btlc.is_finished())
{
auto rc = RemoteRC{btlc.consume_dict_consumer()};
auto rc = RemoteRC{btlc.consume_dict_data()};
rids.emplace(rc.router_id());
}
}

@ -314,6 +314,7 @@ namespace llarp
void
bt_verify(oxenc::bt_dict_consumer& data, bool reject_expired = false) const;
explicit RemoteRC(oxenc::bt_dict_consumer btdc);
public:
RemoteRC() = default;
explicit RemoteRC(std::string_view data) : RemoteRC{oxenc::bt_dict_consumer{data}}
@ -324,7 +325,6 @@ namespace llarp
{
_payload = data;
}
explicit RemoteRC(oxenc::bt_dict_consumer btdc);
~RemoteRC() = default;
std::string_view

Loading…
Cancel
Save