From 33a27716fc4389e7acb53708f0e02fc9b4606498 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 20 Sep 2014 09:53:50 +0200 Subject: [PATCH] test: Fix DoS tests after c74332c Fix data structure mismatch ... The mind boggles that they were still passing at all. --- src/test/DoS_tests.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index af01e5518c..7bec12b665 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -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 mapOrphanTransactions; +struct COrphanTx { + CTransaction tx; + NodeId fromPeer; +}; +extern std::map mapOrphanTransactions; extern std::map > mapOrphanTransactionsByPrev; CService ip(uint32_t i) @@ -149,11 +153,11 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits) CTransaction RandomOrphan() { - std::map::iterator it; + std::map::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)