common/read_peer_msg: remove.

Also means we simplify the handle_gossip_msg() since everyone wants it to
use sync_crypto_write().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-02 16:19:56 +09:30
parent 41c9431ae0
commit 136f10e4a3
5 changed files with 10 additions and 138 deletions

View File

@@ -2488,9 +2488,7 @@ int main(int argc, char *argv[])
if (msg) {
status_trace("Now dealing with deferred gossip %u",
fromwire_peektype(msg));
handle_gossip_msg(take(msg), &peer->cs,
sync_crypto_write_arg,
NULL);
handle_gossip_msg(PEER_FD, &peer->cs, take(msg));
continue;
}
@@ -2523,9 +2521,7 @@ int main(int argc, char *argv[])
* connection comes in. */
if (!msg)
peer_failed_connection_lost();
handle_gossip_msg(msg, &peer->cs,
sync_crypto_write_arg,
peer);
handle_gossip_msg(PEER_FD, &peer->cs, take(msg));
} else if (FD_ISSET(PEER_FD, &rfds)) {
/* This could take forever, but who cares? */
msg = sync_crypto_read(tmpctx, &peer->cs, PEER_FD);