pull/2232/head
dr7ana 6 months ago
parent eb62185160
commit 4328212c2c

@ -656,7 +656,7 @@ namespace llarp
btdc.required("local");
auto rc_dict = btdc.consume_dict_data();
log::critical(logcat, "incoming dict data: {}", oxenc::to_hex(rc_dict));
remote = RemoteRC{oxenc::bt_dict_consumer{rc_dict}};
remote = RemoteRC{rc_dict};
quantity = btdc.require<size_t>("quantity");
}
catch (const std::exception& e)
@ -808,10 +808,10 @@ namespace llarp
{
auto btlp = btdp.append_list("routers");
const auto& known_rcs = node_db->get_known_rcs();
const auto& known_rids = node_db->get_known_rids();
for (const auto& rc : known_rcs)
btlp.append_encoded(rc.view());
for (const auto& rid : known_rids)
btlp.append(rid.ToView());
}
btdp.append_signature("signature", [this](ustring_view to_sign) {

@ -61,12 +61,14 @@ namespace llarp
"Invalid RC netid: expected {}, got {}; this is an RC for a different network!"_format(
ACTIVE_NETID, netid)};
auto pk = data.require<std::string_view>("p");
_router_id.from_string(data.require<std::string_view>("p"));
if (pk.size() != RouterID::SIZE)
throw std::runtime_error{"Invalid RC: router id has invalid size {}"_format(pk.size())};
// auto pk = data.require<std::string_view>("p");
std::memcpy(_router_id.data(), pk.data(), RouterID::SIZE);
// if (pk.size() != RouterID::SIZE)
// throw std::runtime_error{"Invalid RC: router id has invalid size {}"_format(pk.size())};
// std::memcpy(_router_id.data(), pk.data(), RouterID::SIZE);
_timestamp = rc_time{std::chrono::seconds{data.require<int64_t>("t")}};

Loading…
Cancel
Save