MCPcopy Create free account
hub / github.com/ElementsProject/elements / build_next_block

Method build_next_block

test/functional/p2p_segwit.py:233–240  ·  view source on GitHub ↗

Build a block on top of node0's tip.

(self)

Source from the content-addressed store, hash-verified

231 # Helper functions
232
233 def build_next_block(self):
234 """Build a block on top of node0's tip."""
235 tip = self.nodes[0].getbestblockhash()
236 height = self.nodes[0].getblockcount() + 1
237 block_time = self.nodes[0].getblockheader(tip)["mediantime"] + 1
238 block = create_block(int(tip, 16), create_coinbase(height), block_time)
239 block.rehash()
240 return block
241
242 def update_witness_block_with_transactions(self, block, tx_list, nonce=0):
243 """Add list of transactions to block, adds witness commitment, then solves."""

Calls 3

create_blockFunction · 0.90
create_coinbaseFunction · 0.90
rehashMethod · 0.45