mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
gossipd: make sure master only ever sees one active connection.
When we get a reconnection, kill the current remote peer, and wait for the master to tell us it's dead. Then we hand it the new peer. Previously, we would end up with gossipd holding multiple peers, and the logging was really hard to interpret; I'm not completely convinced that we did the right thing when one terminated, either. Note that this now means we can have peers with neither ->local nor ->remote populated, so we check that more carefully. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3131,8 +3131,9 @@ class LightningDTests(BaseLightningDTests):
|
||||
# Reconnect.
|
||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.info['port'])
|
||||
|
||||
# We should get a message about reconnecting.
|
||||
l2.daemon.wait_for_log('Killing openingd: Peer reconnected')
|
||||
# We should get a message about reconnecting, but order unsynced.
|
||||
l2.daemon.wait_for_logs(['gossipd.*reconnect for active peer',
|
||||
'openingd.*Error reading gossip msg'])
|
||||
|
||||
# Should work fine.
|
||||
l1.rpc.fundchannel(l2.info['id'], 20000)
|
||||
|
||||
Reference in New Issue
Block a user