channeld: don't use ccan/io, go sync.

We revert to a simple select() loop.  This makes things simpler, and fixes
the problem where we want to exit but we've partially read a peer packet.

We still queue up outgoing peer packets for non-blocking send: if we
went full sync there, we'd risk deadlock if both sides wrote a huge
number of packets and neither was reading.

This also greatly simplifies the next patches, where we want to make
our first get/response from gossipd.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-11-29 09:20:14 +10:30 committed by Christian Decker
parent ed8d65c8d7
commit 9de3827199
2 changed files with 285 additions and 273 deletions

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,7 @@ open_channel,219,delayed_payment_basepoint,33
open_channel,252,htlc_basepoint,33
open_channel,285,first_per_commitment_point,33
open_channel,318,channel_flags,1
open_channel,319,shutdown_len,2,option_upfront_shutdown_script
accept_channel,33
accept_channel,0,temporary_channel_id,32
accept_channel,32,dust_limit_satoshis,8
@ -48,6 +49,7 @@ accept_channel,138,payment_basepoint,33
accept_channel,171,delayed_payment_basepoint,33
accept_channel,204,htlc_basepoint,33
accept_channel,237,first_per_commitment_point,33
accept_channel,270,shutdown_len,2,option_upfront_shutdown_script
funding_created,34
funding_created,0,temporary_channel_id,32
funding_created,32,funding_txid,32