Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mempool_resurrect.py
Show All 24 Lines | def run_test(self): | ||||
# ... make sure all the transactions are confirmed | # ... make sure all the transactions are confirmed | ||||
# Invalidate both blocks | # Invalidate both blocks | ||||
# ... make sure all the transactions are put back in the mempool | # ... make sure all the transactions are put back in the mempool | ||||
# Mine a new block | # Mine a new block | ||||
# ... make sure all the transactions are confirmed again. | # ... make sure all the transactions are confirmed again. | ||||
b = [self.nodes[0].getblockhash(n) for n in range(1, 4)] | b = [self.nodes[0].getblockhash(n) for n in range(1, 4)] | ||||
coinbase_txids = [self.nodes[0].getblock(h)['tx'][0] for h in b] | coinbase_txids = [self.nodes[0].getblock(h)['tx'][0] for h in b] | ||||
spends1_raw = [create_raw_transaction(self.nodes[0], txid, node0_address, amount=49.99) | spends1_raw = [create_raw_transaction(self.nodes[0], txid, node0_address, amount=49990000) | ||||
for txid in coinbase_txids] | for txid in coinbase_txids] | ||||
spends1_id = [self.nodes[0].sendrawtransaction(tx) | spends1_id = [self.nodes[0].sendrawtransaction(tx) | ||||
for tx in spends1_raw] | for tx in spends1_raw] | ||||
blocks = [] | blocks = [] | ||||
blocks.extend(self.nodes[0].generate(1)) | blocks.extend(self.nodes[0].generate(1)) | ||||
spends2_raw = [create_raw_transaction(self.nodes[0], txid, node0_address, amount=49.98) | spends2_raw = [create_raw_transaction(self.nodes[0], txid, node0_address, amount=49980000) | ||||
for txid in spends1_id] | for txid in spends1_id] | ||||
spends2_id = [self.nodes[0].sendrawtransaction(tx) | spends2_id = [self.nodes[0].sendrawtransaction(tx) | ||||
for tx in spends2_raw] | for tx in spends2_raw] | ||||
blocks.extend(self.nodes[0].generate(1)) | blocks.extend(self.nodes[0].generate(1)) | ||||
# mempool should be empty, all txns confirmed | # mempool should be empty, all txns confirmed | ||||
assert_equal(set(self.nodes[0].getrawmempool()), set()) | assert_equal(set(self.nodes[0].getrawmempool()), set()) | ||||
Show All 26 Lines |