diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-21 21:25:19 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-21 21:25:25 +0200 |
commit | ae9966ed854b8b4db50beba0fc325dff5df2a995 (patch) | |
tree | 416c0fc20a7c475de60b90ef7b01600ecb6aa97e /src | |
parent | 934b153a2caba4071a614e5b3ef40feeaff631d4 (diff) | |
parent | 33a27716fc4389e7acb53708f0e02fc9b4606498 (diff) |
Merge pull request #4950
33a2771 test: Fix DoS tests after c74332c (Wladimir J. van der Laan)
Diffstat (limited to 'src')
-rw-r--r-- | src/test/DoS_tests.cpp | 10 |
1 files 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<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) @@ -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) |