Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/bitcoin.cpp
// Copyright (c) 2017-2020 The Bitcoin developers | // Copyright (c) 2017-2020 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. | ||||
#include <seeder/bitcoin.h> | #include <seeder/bitcoin.h> | ||||
#include <hash.h> | #include <hash.h> | ||||
#include <netbase.h> | #include <netbase.h> | ||||
#include <primitives/block.h> | |||||
Fabien: You also need to #include `<primitives/blockhash.h>` and `chainparams.h` | |||||
#include <seeder/db.h> | #include <seeder/db.h> | ||||
#include <seeder/messagewriter.h> | #include <seeder/messagewriter.h> | ||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <uint256.h> | #include <uint256.h> | ||||
#include <algorithm> | #include <algorithm> | ||||
// The network magic to use. | // The network magic to use. | ||||
Show All 40 Lines | PeerMessagingState CSeederNode::ProcessMessage(std::string strCommand, | ||||
if (strCommand == NetMsgType::VERACK) { | if (strCommand == NetMsgType::VERACK) { | ||||
vRecv.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); | vRecv.SetVersion(std::min(nVersion, PROTOCOL_VERSION)); | ||||
// tfm::format(std::cout, "\n%s: version %i\n", ToString(you), | // tfm::format(std::cout, "\n%s: version %i\n", ToString(you), | ||||
// nVersion); | // nVersion); | ||||
if (vAddr) { | if (vAddr) { | ||||
vSend += | vSend += | ||||
WriteMessage(vSend.GetVersion(), NetMsgType::GETADDR, netMagic); | WriteMessage(vSend.GetVersion(), NetMsgType::GETADDR, netMagic); | ||||
std::vector<BlockHash> locatorHash( | |||||
1, Params().Checkpoints().mapCheckpoints.rbegin()->second); | |||||
vSend += | |||||
WriteMessage(vSend.GetVersion(), NetMsgType::GETHEADERS, | |||||
netMagic, CBlockLocator(locatorHash), uint256()); | |||||
doneAfter = time(nullptr) + GetTimeout(); | doneAfter = time(nullptr) + GetTimeout(); | ||||
} else { | } else { | ||||
doneAfter = time(nullptr) + 1; | doneAfter = time(nullptr) + 1; | ||||
} | } | ||||
return PeerMessagingState::AwaitingMessages; | return PeerMessagingState::AwaitingMessages; | ||||
} | } | ||||
if (strCommand == NetMsgType::ADDR && vAddr) { | if (strCommand == NetMsgType::ADDR && vAddr) { | ||||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |
You also need to #include <primitives/blockhash.h> and chainparams.h