mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add p2p-fullblocktest.py
This commit is contained in:
@@ -153,7 +153,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
blocks_h2 = [] # the height 2 blocks on each node's chain
|
||||
block_time = time.time() + 1
|
||||
for i in xrange(2):
|
||||
blocks_h2.append(create_block(tips[i], create_coinbase(), block_time))
|
||||
blocks_h2.append(create_block(tips[i], create_coinbase(2), block_time))
|
||||
blocks_h2[i].solve()
|
||||
block_time += 1
|
||||
test_node.send_message(msg_block(blocks_h2[0]))
|
||||
@@ -167,7 +167,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
# 3. Send another block that builds on the original tip.
|
||||
blocks_h2f = [] # Blocks at height 2 that fork off the main chain
|
||||
for i in xrange(2):
|
||||
blocks_h2f.append(create_block(tips[i], create_coinbase(), blocks_h2[i].nTime+1))
|
||||
blocks_h2f.append(create_block(tips[i], create_coinbase(2), blocks_h2[i].nTime+1))
|
||||
blocks_h2f[i].solve()
|
||||
test_node.send_message(msg_block(blocks_h2f[0]))
|
||||
white_node.send_message(msg_block(blocks_h2f[1]))
|
||||
@@ -186,7 +186,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
# 4. Now send another block that builds on the forking chain.
|
||||
blocks_h3 = []
|
||||
for i in xrange(2):
|
||||
blocks_h3.append(create_block(blocks_h2f[i].sha256, create_coinbase(), blocks_h2f[i].nTime+1))
|
||||
blocks_h3.append(create_block(blocks_h2f[i].sha256, create_coinbase(3), blocks_h2f[i].nTime+1))
|
||||
blocks_h3[i].solve()
|
||||
test_node.send_message(msg_block(blocks_h3[0]))
|
||||
white_node.send_message(msg_block(blocks_h3[1]))
|
||||
@@ -217,7 +217,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
all_blocks = [] # node0's blocks
|
||||
for j in xrange(2):
|
||||
for i in xrange(288):
|
||||
next_block = create_block(tips[j].sha256, create_coinbase(), tips[j].nTime+1)
|
||||
next_block = create_block(tips[j].sha256, create_coinbase(i + 4), tips[j].nTime+1)
|
||||
next_block.solve()
|
||||
if j==0:
|
||||
test_node.send_message(msg_block(next_block))
|
||||
|
||||
Reference in New Issue
Block a user