Commit 5cac4e1
fix: resolve address mismatch in handle_connect_peer for transient promotion
The peer's advertised address (from PeerKeyLocation) may differ from the
actual TCP connection's remote address stored in self.connections:
- PeerKeyLocation typically contains the peer's listening port
- self.connections is keyed by the actual TCP source port (ephemeral)
Previously, pub_key lookup was only tried when the address was unspecified.
Now we always try pub_key lookup first, ensuring we find the correct
connection entry regardless of address mismatch.
This fixes the CI-only failure in test_three_node_network_connectivity
where QueryConnections returned insufficient connections because pub_key
wasn't being set on connections with mismatched addresses.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 71fba53 commit 5cac4e1
1 file changed
+20
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1453 | 1458 | | |
1454 | 1459 | | |
1455 | 1460 | | |
1456 | | - | |
| 1461 | + | |
| 1462 | + | |
1457 | 1463 | | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
| 1464 | + | |
1465 | 1465 | | |
1466 | 1466 | | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
1467 | 1475 | | |
1468 | 1476 | | |
1469 | 1477 | | |
| |||
0 commit comments