mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-18 01:25:50 +00:00
chore: fix warnings (#509)
Co-authored-by: Denis Angell <dangell@transia.co> Co-authored-by: RichardAH <richard.holland@starstone.co.nz>
This commit is contained in:
@@ -221,7 +221,8 @@ public:
|
|||||||
|
|
||||||
if (!ledger->info().accountHash.isNonZero())
|
if (!ledger->info().accountHash.isNonZero())
|
||||||
{
|
{
|
||||||
JLOG(j.fatal()) << "AH is zero: " << getJson({*ledger, {}});
|
JLOG(j.fatal())
|
||||||
|
<< "AH is zero: " << getJson({*ledger, {}}).asString();
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -239,19 +239,17 @@ verifyHandshake(
|
|||||||
throw std::runtime_error("Invalid server domain");
|
throw std::runtime_error("Invalid server domain");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the network. Omitting Network-ID (on either side ours, or theirs)
|
// Check network ID, treating absent/empty as default network 0
|
||||||
// means NID=0
|
|
||||||
{
|
{
|
||||||
uint32_t peer_nid = 0;
|
std::uint32_t nid{0};
|
||||||
|
|
||||||
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
|
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
|
||||||
{
|
{
|
||||||
if (!beast::lexicalCastChecked(
|
if (!beast::lexicalCastChecked(nid, std::string(iter->value())))
|
||||||
peer_nid, std::string(iter->value())))
|
|
||||||
throw std::runtime_error("Invalid peer network identifier");
|
throw std::runtime_error("Invalid peer network identifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t our_nid = networkID ? *networkID : 0;
|
if (networkID.value_or(0) != nid)
|
||||||
if (peer_nid != our_nid)
|
|
||||||
throw std::runtime_error("Peer is on a different network");
|
throw std::runtime_error("Peer is on a different network");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user