Skip to content

Commit

Permalink
Merge pull request #28 from Beldex-Coin/dev
Browse files Browse the repository at this point in the history
Merge Dev Into Master
  • Loading branch information
sanada08 authored Dec 18, 2023
2 parents 815f11f + 06e00eb commit 58d31cf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
23 changes: 15 additions & 8 deletions llarp/config/definition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ namespace llarp
const std::string& section, std::vector<std::string> comments)
{
auto& sectionComments = m_sectionComments[section];
for (size_t i = 0; i < comments.size(); ++i)
{
sectionComments.emplace_back(std::move(comments[i]));
}
for (auto& c : comments)
sectionComments.emplace_back(std::move(c));
}

void
Expand Down Expand Up @@ -199,13 +197,22 @@ namespace llarp
if (useValues and def->getNumberFound() > 0)
{
for (const auto& val : def->valuesAsString())
fmt::format_to(sect_append, "\n{}={}\n", name, val);
fmt::format_to(sect_append, "\n{}={}", name, val);
*sect_append = '\n';
}
else if (not(def->hidden and not has_comment))
else if (not def->hidden)
{
for (const auto& val : def->defaultValuesAsString())
fmt::format_to(sect_append, "\n{}{}={}\n", def->required ? "" : "#", name, val);
if (auto defaults = def->defaultValuesAsString(); not defaults.empty())
for (const auto& val : defaults)
fmt::format_to(sect_append, "\n{}{}={}", def->required ? "" : "#", name, val);
else
// We have no defaults so we append it as "#opt-name=" so that we show the option name,
// and make it simple to uncomment and edit to the desired value.
fmt::format_to(sect_append, "\n#{}=", name);
*sect_append = '\n';
}
else if (has_comment)
*sect_append = '\n';
});

if (sect_str.empty())
Expand Down
2 changes: 1 addition & 1 deletion llarp/iwp/linklayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace llarp::iwp
bool success = session->Recv_LL(std::move(pkt));
if (not success and isNewSession)
{
LogWarn("Brand new session failed; removing from pending sessions list");
LogDebug("Brand new session failed; removing from pending sessions list");
m_Pending.erase(from);
}
WakeupPlaintext();
Expand Down
4 changes: 2 additions & 2 deletions llarp/iwp/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ namespace llarp
const ShortHash expected{buf.base};
if (H != expected)
{
LogError(
LogDebug(
m_Parent->PrintableName(),
" keyed hash mismatch ",
H,
Expand Down Expand Up @@ -976,7 +976,7 @@ namespace llarp
}
else
{
LogWarn("bad intro from ", m_RemoteAddr);
LogDebug("bad intro from ", m_RemoteAddr);
return false;
}
}
Expand Down

0 comments on commit 58d31cf

Please sign in to comment.