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 <chainparams.h> | |||||
#include <hash.h> | #include <hash.h> | ||||
#include <netbase.h> | #include <netbase.h> | ||||
#include <primitives/blockhash.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 <util/time.h> | #include <util/time.h> | ||||
#include <algorithm> | #include <algorithm> | ||||
Show All 37 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) { | ||||
MessageWriter::WriteMessage(vSend, NetMsgType::GETADDR); | MessageWriter::WriteMessage(vSend, NetMsgType::GETADDR); | ||||
std::vector<BlockHash> locatorHash( | |||||
1, Params().Checkpoints().mapCheckpoints.rbegin()->second); | |||||
MessageWriter::WriteMessage(vSend, NetMsgType::GETHEADERS, | |||||
CBlockLocator(locatorHash), uint256()); | |||||
doneAfter = GetTime() + GetTimeout(); | doneAfter = GetTime() + GetTimeout(); | ||||
} else { | } else { | ||||
doneAfter = GetTime() + 1; | doneAfter = GetTime() + 1; | ||||
} | } | ||||
return PeerMessagingState::AwaitingMessages; | return PeerMessagingState::AwaitingMessages; | ||||
} | } | ||||
if (strCommand == NetMsgType::ADDR && vAddr) { | if (strCommand == NetMsgType::ADDR && vAddr) { | ||||
▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines |