[refactor] Remove netaddress.h from kernel headers

Move functions requiring the netaddress.h include out of
libbitcoinkernel source files.

The netaddress.h file contains many non-consensus related definitions
and should thus not be part of the libbitcoinkernel. This commit makes
netaddress.h no longer a required include for users of the
libbitcoinkernel.

This commit is part of the libbitcoinkernel project, namely its stage 1
step 3: Decouple most non-consensus headers from libbitcoinkernel.
This commit is contained in:
TheCharlatan
2023-09-12 13:42:52 +02:00
parent 2b08c55f01
commit 36193af47c
3 changed files with 15 additions and 12 deletions

View File

@@ -8,7 +8,6 @@
#include <consensus/params.h>
#include <kernel/messagestartchars.h>
#include <netaddress.h>
#include <primitives/block.h>
#include <uint256.h>
#include <util/chaintype.h>
@@ -89,15 +88,6 @@ public:
const Consensus::Params& GetConsensus() const { return consensus; }
const MessageStartChars& MessageStart() const { return pchMessageStart; }
uint16_t GetDefaultPort() const { return nDefaultPort; }
uint16_t GetDefaultPort(Network net) const
{
return net == NET_I2P ? I2P_SAM31_PORT : GetDefaultPort();
}
uint16_t GetDefaultPort(const std::string& addr) const
{
CNetAddr a;
return a.SetSpecial(addr) ? GetDefaultPort(a.GetNetwork()) : GetDefaultPort();
}
const CBlock& GenesisBlock() const { return genesis; }
/** Default value for -checkmempool and -checkblockindex argument */