Add a P2P connection to the node. Helper to connect and wait for version handshake.
(self)
| 1292 | return block |
| 1293 | |
| 1294 | def bootstrap_p2p(self): |
| 1295 | """Add a P2P connection to the node. |
| 1296 | |
| 1297 | Helper to connect and wait for version handshake.""" |
| 1298 | self.nodes[0].add_p2p_connection(P2PDataStore()) |
| 1299 | # We need to wait for the initial getheaders from the peer before we |
| 1300 | # start populating our blockstore. If we don't, then we may run ahead |
| 1301 | # to the next subtest before we receive the getheaders. We'd then send |
| 1302 | # an INV for the next block and receive two getheaders - one for the |
| 1303 | # IBD and one for the INV. We'd respond to both and could get |
| 1304 | # unexpectedly disconnected if the DoS score for that error is 50. |
| 1305 | self.nodes[0].p2p.wait_for_getheaders(timeout=5) |
| 1306 | |
| 1307 | def reconnect_p2p(self): |
| 1308 | """Tear down and bootstrap the P2P connection to the node. |
no test coverage detected