Build a block on top of node0's tip.
(self)
| 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.""" |