(self, block_number, new_transactions)
| 1436 | |
| 1437 | # adds transactions to the block and updates state |
| 1438 | def update_block(self, block_number, new_transactions): |
| 1439 | block = self.blocks[block_number] |
| 1440 | self.add_transactions_to_block(block, new_transactions) |
| 1441 | old_sha256 = block.sha256 |
| 1442 | block.hashMerkleRoot = block.calc_merkle_root() |
| 1443 | block.solve() |
| 1444 | # Update the internal state just like in next_block |
| 1445 | self.tip = block |
| 1446 | if block.sha256 != old_sha256: |
| 1447 | self.block_heights[block.sha256] = self.block_heights[old_sha256] |
| 1448 | del self.block_heights[old_sha256] |
| 1449 | self.blocks[block_number] = block |
| 1450 | return block |
| 1451 | |
| 1452 | def bootstrap_p2p(self, timeout=10): |
| 1453 | """Add a P2P connection to the node. |
no test coverage detected