mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
lightningd/peer_control: don't create peer struct until we've connected.
We currently create a peer struct, then complete handshake to find out who it is. This means we have a half-formed peer, and worse: if it's a reconnect we get two peers the same. Add an explicit 'struct connection' for the handshake phase, and construct a 'struct peer' once that's done. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -193,8 +193,6 @@ class LightningDTests(BaseLightningDTests):
|
||||
assert p2['state'] == 'GOSSIPING'
|
||||
|
||||
# It should have gone through these steps
|
||||
print(p1['log'])
|
||||
assert 'state: HANDSHAKING -> INITIALIZING' in p1['log']
|
||||
assert 'state: INITIALIZING -> GOSSIPING' in p1['log']
|
||||
|
||||
# Both should still be owned by gossip
|
||||
|
||||
Reference in New Issue
Block a user