mirror of
				https://github.com/Xahau/xahaud.git
				synced 2025-11-04 02:35:48 +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())
 | 
			
		||||
        {
 | 
			
		||||
            JLOG(j.fatal()) << "AH is zero: " << getJson({*ledger, {}});
 | 
			
		||||
            JLOG(j.fatal())
 | 
			
		||||
                << "AH is zero: " << getJson({*ledger, {}}).asString();
 | 
			
		||||
            assert(false);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -239,19 +239,17 @@ verifyHandshake(
 | 
			
		||||
            throw std::runtime_error("Invalid server domain");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Check the network. Omitting Network-ID (on either side ours, or theirs)
 | 
			
		||||
    // means NID=0
 | 
			
		||||
    // Check network ID, treating absent/empty as default network 0
 | 
			
		||||
    {
 | 
			
		||||
        uint32_t peer_nid = 0;
 | 
			
		||||
        std::uint32_t nid{0};
 | 
			
		||||
 | 
			
		||||
        if (auto const iter = headers.find("Network-ID"); iter != headers.end())
 | 
			
		||||
        {
 | 
			
		||||
            if (!beast::lexicalCastChecked(
 | 
			
		||||
                    peer_nid, std::string(iter->value())))
 | 
			
		||||
            if (!beast::lexicalCastChecked(nid, std::string(iter->value())))
 | 
			
		||||
                throw std::runtime_error("Invalid peer network identifier");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        uint32_t our_nid = networkID ? *networkID : 0;
 | 
			
		||||
        if (peer_nid != our_nid)
 | 
			
		||||
        if (networkID.value_or(0) != nid)
 | 
			
		||||
            throw std::runtime_error("Peer is on a different network");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user