aboutsummaryrefslogtreecommitdiff
path: root/src/test/mempool_tests.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-12-15 17:03:23 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-12-15 17:03:31 +0100
commit1eef038b1bcf7852a1c9912db429467255d2a036 (patch)
treea3f74946fba55928b8be76d029f7992017f8bad8 /src/test/mempool_tests.cpp
parent5bc209c73fb6109829f24a6e9574ce112432b560 (diff)
parentc5c92c46fbe1ebc9ab411ae06d5416ff91f9f340 (diff)
Merge #7562: Bump transaction version default to 2
c5c92c4 Update python tests for default tx version=2 (BtcDrak) dab207e Preserve tx version=1 for certain tests (BtcDrak) c5d746a tiny test fix for mempool_tests (Alex Morcos) 1f0ca1a Bump default transaction version to 2 (BtcDrak)
Diffstat (limited to 'src/test/mempool_tests.cpp')
-rw-r--r--src/test/mempool_tests.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp
index bdd6eaf538..84871600b2 100644
--- a/src/test/mempool_tests.cpp
+++ b/src/test/mempool_tests.cpp
@@ -390,7 +390,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();
@@ -417,7 +422,11 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
pool.removeForBlock(vtx, 1);
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);
}