lightningd/gossip: Move INIT message handling to handshake daemon.

We need to do this on every connection, whether reconnecting or not,
so it makes sense for the handshake daemon to handle it and return
the feature fields.

Longer term I'm considering having the handshake daemon handle the
listening and connecting, and simply hand the fds back once the peers
are ready.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-05-22 20:56:51 +09:30
parent 0c8b24cf97
commit 662dfef436
7 changed files with 120 additions and 110 deletions

View File

@@ -163,8 +163,8 @@ class LightningDTests(BaseLightningDTests):
assert ret['id'] == l2.info['id']
l1.daemon.wait_for_log('WIRE_GOSSIPSTATUS_PEER_READY')
l2.daemon.wait_for_log('WIRE_GOSSIPSTATUS_PEER_READY')
l1.daemon.wait_for_log('WIRE_GOSSIPCTL_NEW_PEER')
l2.daemon.wait_for_log('WIRE_GOSSIPCTL_NEW_PEER')
return l1,l2
def fund_channel(self,l1,l2,amount):
@@ -398,7 +398,7 @@ class LightningDTests(BaseLightningDTests):
assert ret['id'] == l3.info['id']
l3.daemon.wait_for_log('WIRE_GOSSIPSTATUS_PEER_READY')
l3.daemon.wait_for_log('WIRE_GOSSIPCTL_NEW_PEER')
self.fund_channel(l1, l2, 10**6)
self.fund_channel(l2, l3, 10**6)