Skip to content

Commit 511a5af

Browse files
committed
Fixed inconsistencies between code and comments
1) Makes the code for block 44 consistent with the expected figure in the comment above it by adding a transaction to the block 2) Fixed comment describing sign_tx() function
1 parent 6bc1eca commit 511a5af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/functional/feature_block.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ def run_test(self):
591591
b44.hashPrevBlock = self.tip.sha256
592592
b44.nBits = 0x207fffff
593593
b44.vtx.append(coinbase)
594+
tx = self.create_and_sign_transaction(out[14], 1)
595+
b44.vtx.append(tx)
594596
b44.hashMerkleRoot = b44.calc_merkle_root()
595597
b44.solve()
596598
self.tip = b44
@@ -678,7 +680,7 @@ def run_test(self):
678680
# Test block timestamps
679681
# -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15)
680682
# \-> b54 (15)
681-
#
683+
# -> b44 (14)\-> b48 ()
682684
self.move_tip(43)
683685
b53 = self.next_block(53, spend=out[14])
684686
self.send_blocks([b53], False)
@@ -1308,7 +1310,7 @@ def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE, OP_DROP] * 15 +
13081310
return create_tx_with_script(spend_tx, n, amount=value, script_pub_key=script)
13091311

13101312
# sign a transaction, using the key we know about
1311-
# this signs input 0 in tx, which is assumed to be spending output n in spend_tx
1313+
# this signs input 0 in tx, which is assumed to be spending output 0 in spend_tx
13121314
def sign_tx(self, tx, spend_tx):
13131315
scriptPubKey = bytearray(spend_tx.vout[0].scriptPubKey)
13141316
if (scriptPubKey[0] == OP_TRUE): # an anyone-can-spend

0 commit comments

Comments
 (0)