Changeset View
Changeset View
Standalone View
Standalone View
src/test/DoS_tests.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core 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. | ||||
// Unit tests for denial-of-service detection/prevention code | // Unit tests for denial-of-service detection/prevention code | ||||
#include "chainparams.h" | #include <chainparams.h> | ||||
#include "config.h" | #include <config.h> | ||||
#include "keystore.h" | #include <keystore.h> | ||||
#include "net.h" | #include <net.h> | ||||
#include "net_processing.h" | #include <net_processing.h> | ||||
#include "pow.h" | #include <pow.h> | ||||
#include "script/sign.h" | #include <script/sign.h> | ||||
#include "serialize.h" | #include <serialize.h> | ||||
#include "util.h" | #include <util.h> | ||||
#include "validation.h" | #include <validation.h> | ||||
#include "test/test_bitcoin.h" | #include <test/test_bitcoin.h> | ||||
#include <cstdint> | |||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <cstdint> | |||||
// Tests these internal-to-net_processing.cpp methods: | // Tests these internal-to-net_processing.cpp methods: | ||||
extern bool AddOrphanTx(const CTransactionRef &tx, NodeId peer); | extern bool AddOrphanTx(const CTransactionRef &tx, NodeId peer); | ||||
extern void EraseOrphansFor(NodeId peer); | extern void EraseOrphansFor(NodeId peer); | ||||
extern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans); | extern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans); | ||||
struct COrphanTx { | struct COrphanTx { | ||||
CTransactionRef tx; | CTransactionRef tx; | ||||
NodeId fromPeer; | NodeId fromPeer; | ||||
int64_t nTimeExpire; | int64_t nTimeExpire; | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |