Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/bitcoin.h
// Copyright (c) 2017-2019 The Bitcoin developers | // Copyright (c) 2017-2019 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_SEEDER_BITCOIN_H | #ifndef BITCOIN_SEEDER_BITCOIN_H | ||||
#define BITCOIN_SEEDER_BITCOIN_H | #define BITCOIN_SEEDER_BITCOIN_H | ||||
#include <protocol.h> | #include <protocol.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
/** | |||||
* The seeder do not use the Params facility. | |||||
* | |||||
* While this is sorted out, we need a replacement. | |||||
*/ | |||||
extern bool fTestNet; | |||||
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet) { | |||||
return testnet ? 18333 : 8333; | |||||
} | |||||
// The network magic to use. | |||||
extern CMessageHeader::MessageMagic netMagic; | |||||
class CSeederNode { | class CSeederNode { | ||||
private: | private: | ||||
SOCKET sock; | SOCKET sock; | ||||
CDataStream vSend; | CDataStream vSend; | ||||
CDataStream vRecv; | CDataStream vRecv; | ||||
uint32_t nHeaderStart; | uint32_t nHeaderStart; | ||||
uint32_t nMessageStart; | uint32_t nMessageStart; | ||||
int nVersion; | int nVersion; | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |