mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
feature_blocksign.py: Allot for possibility of non-empty block 0.5RTT
This commit is contained in:
parent
59a9601ed0
commit
128d7e0043
1 changed files with 5 additions and 2 deletions
|
|
@ -114,16 +114,19 @@ class BlockSignTest(BitcoinTestFramework):
|
||||||
# miner makes a block
|
# miner makes a block
|
||||||
block = miner.getnewblockhex()
|
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):
|
for i in range(self.num_keys):
|
||||||
if i == mineridx:
|
if i == mineridx:
|
||||||
continue
|
continue
|
||||||
sketch = miner.getcompactsketch(block)
|
sketch = miner.getcompactsketch(block)
|
||||||
compact_response = self.nodes[i].consumecompactsketch(sketch)
|
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"])
|
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"])
|
final_block = self.nodes[i].finalizecompactblock(sketch, block_txn, compact_response["found_transactions"])
|
||||||
else:
|
else:
|
||||||
|
assert (mineridx == 4 and i == 0) or not make_transactions
|
||||||
# If there's only coinbase, it should succeed immediately
|
# If there's only coinbase, it should succeed immediately
|
||||||
final_block = compact_response["blockhex"]
|
final_block = compact_response["blockhex"]
|
||||||
# Block should be complete, sans signatures
|
# Block should be complete, sans signatures
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue