remove cosmetic changes

This commit is contained in:
Denis Angell
2025-05-08 09:02:24 +02:00
parent 9b47d06c64
commit fdc2a0e5a6
2 changed files with 5 additions and 7 deletions

View File

@@ -224,8 +224,7 @@ public:
if (!ledger->info().accountHash.isNonZero())
{
JLOG(j.fatal())
<< "AH is zero: " << getJson({*ledger, {}}).asString();
JLOG(j.fatal()) << "AH is zero: " << getJson({*ledger, {}});
assert(false);
}

View File

@@ -239,7 +239,8 @@ verifyHandshake(
throw std::runtime_error("Invalid server domain");
}
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
// Check the network. Omitting Network-ID (on either side ours, or theirs)
// means NID=0
{
uint32_t peer_nid = 0;
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
@@ -249,10 +250,8 @@ verifyHandshake(
throw std::runtime_error("Invalid peer network identifier");
}
if (!beast::lexicalCastChecked(peer_nid, std::string(iter->value())))
throw std::runtime_error("Invalid peer network identifier");
if (networkID && peer_nid != *networkID)
uint32_t our_nid = networkID ? *networkID : 0;
if (peer_nid != our_nid)
throw std::runtime_error("Peer is on a different network");
}