Skip to content

Commit

Permalink
Merge #750: [0.18] feature_blocksign.py: Allot for possibility of non…
Browse files Browse the repository at this point in the history
…-empty block 0.5RTT

128d7e0 feature_blocksign.py: Allot for possibility of non-empty block 0.5RTT (Gregory Sanders)

Pull request description:

  Backport of #747

Tree-SHA512: 9d5aaeb47bc595975fd45269aa2d2d99f943a4dc53739791e558a3eb682c08c60cc7bf761c6c4e230d919c8e4da3926738b8c8655ec4bc02a3f7ce9c65d3361e
  • Loading branch information
instagibbs committed Oct 22, 2019
2 parents 59a9601 + 128d7e0 commit a043001
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/functional/feature_blocksign.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,19 @@ def mine_block(self, make_transactions):
# miner makes a block
block = miner.getnewblockhex()

# other signing nodes get fed compact blocks
# All nodes get compact blocks, first node may get complete
# block in 0.5 RTT even with transactions thanks to p2p connection
# with non-signing node being miner
for i in range(self.num_keys):
if i == mineridx:
continue
sketch = miner.getcompactsketch(block)
compact_response = self.nodes[i].consumecompactsketch(sketch)
if make_transactions:
if "block_tx_req" in compact_response:
block_txn = self.nodes[i].consumegetblocktxn(block, compact_response["block_tx_req"])
final_block = self.nodes[i].finalizecompactblock(sketch, block_txn, compact_response["found_transactions"])
else:
assert (mineridx == 4 and i == 0) or not make_transactions
# If there's only coinbase, it should succeed immediately
final_block = compact_response["blockhex"]
# Block should be complete, sans signatures
Expand Down

0 comments on commit a043001

Please sign in to comment.