Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_bip68_sequence.py
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | def test_sequence_lock_unconfirmed_inputs(self): | ||||
# Now mine 2 empty blocks to reorg out the current tip (labeled tip-1 in | # Now mine 2 empty blocks to reorg out the current tip (labeled tip-1 in | ||||
# diagram above). | # diagram above). | ||||
# This would cause tx2 to be added back to the mempool, which in turn causes | # This would cause tx2 to be added back to the mempool, which in turn causes | ||||
# tx3 to be removed. | # tx3 to be removed. | ||||
tip = int(self.nodes[0].getblockhash( | tip = int(self.nodes[0].getblockhash( | ||||
self.nodes[0].getblockcount() - 1), 16) | self.nodes[0].getblockcount() - 1), 16) | ||||
height = self.nodes[0].getblockcount() | height = self.nodes[0].getblockcount() | ||||
cur_time = self.nodes[0].getblockheader( | |||||
self.nodes[0].getbestblockhash())['time'] + 1 | |||||
for i in range(2): | for i in range(2): | ||||
block = create_block(tip, create_coinbase(height), cur_time) | block = create_block(tip, create_coinbase(height), cur_time) | ||||
block.nVersion = 3 | block.nVersion = 3 | ||||
block.rehash() | block.rehash() | ||||
block.solve() | block.solve() | ||||
tip = block.sha256 | tip = block.sha256 | ||||
height += 1 | height += 1 | ||||
self.nodes[0].submitblock(ToHex(block)) | self.nodes[0].submitblock(ToHex(block)) | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |