Changeset View
Changeset View
Standalone View
Standalone View
src/test/net_tests.cpp
// Copyright (c) 2012-2016 The Bitcoin Core developers | // Copyright (c) 2012-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2017-2018 The Bitcoin developers | // Copyright (c) 2017-2018 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 "addrman.h" | #include <net.h> | ||||
#include "chainparams.h" | |||||
#include "clientversion.h" | |||||
#include "config.h" | |||||
#include "hash.h" | |||||
#include "net.h" | |||||
#include "netbase.h" | |||||
#include "serialize.h" | |||||
#include "streams.h" | |||||
#include "test/test_bitcoin.h" | |||||
#include <string> | #include <addrman.h> | ||||
#include <chainparams.h> | |||||
#include <clientversion.h> | |||||
#include <config.h> | |||||
#include <hash.h> | |||||
#include <netbase.h> | |||||
#include <serialize.h> | |||||
#include <streams.h> | |||||
#include <test/test_bitcoin.h> | |||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <string> | |||||
class CAddrManSerializationMock : public CAddrMan { | class CAddrManSerializationMock : public CAddrMan { | ||||
public: | public: | ||||
virtual void Serialize(CDataStream &s) const = 0; | virtual void Serialize(CDataStream &s) const = 0; | ||||
//! Ensure that bucket placement is always the same for testing purposes. | //! Ensure that bucket placement is always the same for testing purposes. | ||||
void MakeDeterministic() { | void MakeDeterministic() { | ||||
nKey.SetNull(); | nKey.SetNull(); | ||||
insecure_rand = FastRandomContext(true); | insecure_rand = FastRandomContext(true); | ||||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |