7#include <chainparams.h>
20#include <validation.h>
24#define BITCOIN_SEED_NONCE 0x0539a019ca550825ULL
105 std::vector<CAddress>::iterator it =
vAddrNew.begin();
120 addr.
nTime > now + 10min) {
121 addr.
nTime = now - 5 * 24
h;
123 if (addr.
nTime > now - 7 * 24
h) {
124 vAddr->push_back(addr);
261 bool connected =
false;
303 const std::string clientVersion =
const CChainParams & Params()
Return the currently selected parameters.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
A CService with information about it as peer.
NodeSeconds nTime
Always included in serialization, except in the network format on INIT_PROTO_VERSION.
const CMessageHeader::MessageMagic & NetMagic() const
Double ended buffer combining vector and stream-like interfaces.
const_iterator begin() const
iterator insert(iterator it, const value_type x)
const_iterator end() const
vector_type::iterator iterator
void resize(size_type n, value_type c=value_type{})
iterator erase(iterator it)
std::string ToStringIP() const
enum Network GetNetwork() const
CSeederNode(const CService &ip, std::vector< CAddress > *vAddrIn)
std::vector< CAddress > * vAddr
ServiceFlags yourServices
PeerMessagingState ProcessMessage(std::string strCommand, CDataStream &recv)
std::chrono::seconds GetTimeout()
std::unique_ptr< Sock > sock
A combination of a network address (CNetAddr) and a (TCP) port.
A Span is an object that can refer to a contiguous sequence of objects.
std::string FormatVersion(int nVersion)
std::string FormatUserAgent(const std::string &name, const std::string &version, const std::vector< std::string > &comments)
Format the subversion field according to BIP 14 spec.
static constexpr int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
const std::string CLIENT_NAME
uint256 Hash(const T &in1)
Compute the 256-bit hash of an object.
Block-chain checkpoints are compiled-in sanity checks.
static void WriteMessage(CDataStream &stream, std::string command, Args &&...args)
const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
std::string userAgent(const Config &config)
static const unsigned int MAX_HEADERS_RESULTS
Number of headers sent in one getheaders result.
bool GetProxy(enum Network net, proxyType &proxyInfoOut)
bool ConnectThroughProxy(const proxyType &proxy, const std::string &strDest, uint16_t port, const Sock &sock, int nTimeout, bool &outProxyConnectionFailed)
Connect to a specified destination service through a SOCKS5 proxy by first connecting to the SOCKS5 p...
std::function< std::unique_ptr< Sock >(const CService &)> CreateSock
Socket factory.
bool ConnectSocketDirectly(const CService &addrConnect, const Sock &sock, int nTimeout, bool manual_connection)
Try to connect to the specified service on the specified socket.
ServiceFlags
nServices flags.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
#define BITCOIN_SEED_NONCE
static const unsigned int ADDR_SOFT_CAP
static int GetRequireHeight()
static bool HasCheckpoint()
static constexpr uint64_t MAX_SIZE
The maximum size of a serialized object in bytes or number of elements (for eg vectors) when the size...
uint64_t ReadCompactSize(Stream &is, bool range_check=true)
Decode a CompactSize-encoded variable-length integer.
size_t GetSerializeSize(const T &t, int nVersion=0)
constexpr auto MakeUCharSpan(V &&v) -> decltype(UCharSpanCast(Span{std::forward< V >(v)}))
Like the Span constructor, but for (const) uint8_t member types only.
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
std::chrono::time_point< NodeClock, std::chrono::seconds > NodeSeconds
static const int PROTOCOL_VERSION
network protocol versioning