mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-06 12:14:14 +00:00
Merge pull request #4950
33a2771 test: Fix DoS tests after c74332c (Wladimir J. van der Laan)
This commit is contained in:
commit
ae9966ed85
@ -27,7 +27,11 @@
|
|||||||
extern bool AddOrphanTx(const CTransaction& tx, NodeId peer);
|
extern bool AddOrphanTx(const CTransaction& 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);
|
||||||
extern std::map<uint256, CTransaction> mapOrphanTransactions;
|
struct COrphanTx {
|
||||||
|
CTransaction tx;
|
||||||
|
NodeId fromPeer;
|
||||||
|
};
|
||||||
|
extern std::map<uint256, COrphanTx> mapOrphanTransactions;
|
||||||
extern std::map<uint256, std::set<uint256> > mapOrphanTransactionsByPrev;
|
extern std::map<uint256, std::set<uint256> > mapOrphanTransactionsByPrev;
|
||||||
|
|
||||||
CService ip(uint32_t i)
|
CService ip(uint32_t i)
|
||||||
@ -149,11 +153,11 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits)
|
|||||||
|
|
||||||
CTransaction RandomOrphan()
|
CTransaction RandomOrphan()
|
||||||
{
|
{
|
||||||
std::map<uint256, CTransaction>::iterator it;
|
std::map<uint256, COrphanTx>::iterator it;
|
||||||
it = mapOrphanTransactions.lower_bound(GetRandHash());
|
it = mapOrphanTransactions.lower_bound(GetRandHash());
|
||||||
if (it == mapOrphanTransactions.end())
|
if (it == mapOrphanTransactions.end())
|
||||||
it = mapOrphanTransactions.begin();
|
it = mapOrphanTransactions.begin();
|
||||||
return it->second;
|
return it->second.tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
|
BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user