Skip to content

Commit

Permalink
Merge pull request #4950
Browse files Browse the repository at this point in the history
33a2771 test: Fix DoS tests after c74332c (Wladimir J. van der Laan)
  • Loading branch information
laanwj committed Sep 21, 2014
2 parents 934b153 + 33a2771 commit ae9966e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/test/DoS_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
extern bool AddOrphanTx(const CTransaction& tx, NodeId peer);
extern void EraseOrphansFor(NodeId peer);
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;

CService ip(uint32_t i)
Expand Down Expand Up @@ -149,11 +153,11 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits)

CTransaction RandomOrphan()
{
std::map<uint256, CTransaction>::iterator it;
std::map<uint256, COrphanTx>::iterator it;
it = mapOrphanTransactions.lower_bound(GetRandHash());
if (it == mapOrphanTransactions.end())
it = mapOrphanTransactions.begin();
return it->second;
return it->second.tx;
}

BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
Expand Down

0 comments on commit ae9966e

Please sign in to comment.