aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_pruning.py
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2018-06-12 16:39:29 -0400
committerGregory Sanders <gsanders87@gmail.com>2018-06-13 10:20:50 -0400
commit86edf4a2a502416ba8d6cebbce61030992f7ff6f (patch)
tree285ddbff2bb0788387d60cd3c364973cd67a273f /test/functional/feature_pruning.py
parenta607d23ae82ee374799d21d02932d945c1ce9616 (diff)
downloadbitcoin-86edf4a2a502416ba8d6cebbce61030992f7ff6f.tar.xz
expose CBlockIndex::nTx in getblock(header)
Diffstat (limited to 'test/functional/feature_pruning.py')
-rwxr-xr-xtest/functional/feature_pruning.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 11a52b9ee2..d400507a66 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -260,10 +260,17 @@ class PruneTest(BitcoinTestFramework):
# should not prune because chain tip of node 3 (995) < PruneAfterHeight (1000)
assert_raises_rpc_error(-1, "Blockchain is too short for pruning", node.pruneblockchain, height(500))
+ # Save block transaction count before pruning, assert value
+ block1_details = node.getblock(node.getblockhash(1))
+ assert_equal(block1_details["nTx"], len(block1_details["tx"]))
+
# mine 6 blocks so we are at height 1001 (i.e., above PruneAfterHeight)
node.generate(6)
assert_equal(node.getblockchaininfo()["blocks"], 1001)
+ # Pruned block should still know the number of transactions
+ assert_equal(node.getblockheader(node.getblockhash(1))["nTx"], block1_details["nTx"])
+
# negative heights should raise an exception
assert_raises_rpc_error(-8, "Negative", node.pruneblockchain, -10)