Coinbases-in-mempool regression test

Immature coinbase spends are allowed in the memory pool if they can be mined in the next block.
They are not allowed in the memory pool if they cannot be mined in the next block.

This regression test tests those edge cases.
This commit is contained in:
Gavin Andresen
2014-12-02 11:44:50 -05:00
parent 90f7aa7778
commit 9e56532959
3 changed files with 81 additions and 1 deletions

View File

@@ -330,4 +330,14 @@ def assert_equal(thing1, thing2):
def assert_greater_than(thing1, thing2):
if thing1 <= thing2:
raise AssertionError("%s <= %s"%(str(thing1),str(thing2)))
raise AssertionError("%s <= %s"%(str(thing1),str(thing2)))
def assert_raises(exc, fun, *args, **kwds):
try:
fun(*args, **kwds)
except exc:
pass
except Exception as e:
raise AssertionError("Unexpected exception raised: "+type(e).__name__)
else:
raise AssertionError("No exception raised")