Add a P2P connection to the node. Helper to connect and wait for version handshake.
(self, timeout=10)
| 1450 | return block |
| 1451 | |
| 1452 | def bootstrap_p2p(self, timeout=10): |
| 1453 | """Add a P2P connection to the node. |
| 1454 | |
| 1455 | Helper to connect and wait for version handshake.""" |
| 1456 | self.helper_peer = self.nodes[0].add_p2p_connection(P2PDataStore()) |
| 1457 | # We need to wait for the initial getheaders from the peer before we |
| 1458 | # start populating our blockstore. If we don't, then we may run ahead |
| 1459 | # to the next subtest before we receive the getheaders. We'd then send |
| 1460 | # an INV for the next block and receive two getheaders - one for the |
| 1461 | # IBD and one for the INV. We'd respond to both and could get |
| 1462 | # unexpectedly disconnected if the DoS score for that error is 50. |
| 1463 | self.helper_peer.wait_for_getheaders(timeout=timeout) |
| 1464 | |
| 1465 | def reconnect_p2p(self, timeout=60): |
| 1466 | """Tear down and bootstrap the P2P connection to the node. |
no test coverage detected