Skip to content

Commit 6c5355e

Browse files
committed
example_test.py: fixup coinbase height argument, derive number clearly
1 parent 6b8d0a2 commit 6c5355e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/example_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ def run_test(self):
164164
self.tip = int(self.nodes[0].getbestblockhash(), 16)
165165
self.block_time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time'] + 1
166166

167-
height = 1
167+
height = self.nodes[0].getblockcount()
168168

169169
for i in range(10):
170170
# Use the mininode and blocktools functionality to manually build a block
171171
# Calling the generate() rpc is easier, but this allows us to exactly
172172
# control the blocks and transactions.
173-
block = create_block(self.tip, create_coinbase(height), self.block_time)
173+
block = create_block(self.tip, create_coinbase(height+1), self.block_time)
174174
block.solve()
175175
block_message = msg_block(block)
176176
# Send message is used to send a P2P message to the node over our P2PInterface

0 commit comments

Comments
 (0)