diff options
author | Alex Morcos <morcos@chaincode.com> | 2016-12-06 16:49:32 -0500 |
---|---|---|
committer | BtcDrak <btcdrak@gmail.com> | 2016-12-08 20:11:39 +0000 |
commit | c5d746ace7c7bc2884c9eefa6c4c0b2c4f89cfb5 (patch) | |
tree | d21638f09b384f05b9b1c21dd2fcfd0cc19af357 | |
parent | 1f0ca1ae1cb369001ecef4ffe32fcd7173dce0c5 (diff) |
tiny test fix for mempool_tests
-rw-r--r-- | src/test/mempool_tests.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp index 1faf8b6aeb..d4c6b0f2be 100644 --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -388,7 +388,12 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest) pool.addUnchecked(tx6.GetHash(), entry.Fee(0LL).FromTx(tx6)); BOOST_CHECK_EQUAL(pool.size(), 6); - sortedOrder.push_back(tx6.GetHash().ToString()); + // Ties are broken by hash + if (tx3.GetHash() < tx6.GetHash()) + sortedOrder.push_back(tx6.GetHash().ToString()); + else + sortedOrder.insert(sortedOrder.end()-1,tx6.GetHash().ToString()); + CheckSort<ancestor_score>(pool, sortedOrder); CMutableTransaction tx7 = CMutableTransaction(); @@ -415,7 +420,11 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest) pool.removeForBlock(vtx, 1, NULL, false); sortedOrder.erase(sortedOrder.begin()+1); - sortedOrder.pop_back(); + // Ties are broken by hash + if (tx3.GetHash() < tx6.GetHash()) + sortedOrder.pop_back(); + else + sortedOrder.erase(sortedOrder.end()-2); sortedOrder.insert(sortedOrder.begin(), tx7.GetHash().ToString()); CheckSort<ancestor_score>(pool, sortedOrder); } |