From 49ab032b5fe4b4262d0e86aaaa8e6988bf70971b Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Tue, 7 Jun 2016 21:05:25 -0600 Subject: [PATCH] Add test to ensure parent treestates only can appear earlier in the transaction or in the global state, not later. --- src/test/coins_tests.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 2edca14e3..c31bb907f 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -251,6 +251,22 @@ BOOST_AUTO_TEST_CASE(chained_pours) BOOST_CHECK(!cache.HavePourRequirements(mtx)); } + { + CMutableTransaction mtx; + mtx.vpour.push_back(ptx2); + mtx.vpour.push_back(ptx1); + + BOOST_CHECK(!cache.HavePourRequirements(mtx)); + } + + { + CMutableTransaction mtx; + mtx.vpour.push_back(ptx1); + mtx.vpour.push_back(ptx2); + + BOOST_CHECK(cache.HavePourRequirements(mtx)); + } + { CMutableTransaction mtx; mtx.vpour.push_back(ptx1);