status: split off error messages into a new 'peer_status' type.

Several daemons (onchaind, hsm) want to use the status messages, but
don't communicate with peers.  The coming changes made them drag in
more code they didn't need, so instead we have a different
non-overlapping type.

We combine the status_received_errmsg and status_sent_errmsg
into a single status_peer_error, with the presence or not of the
'error_for_them' field indicating direction. 

We also rename status_fatal_connection_lost() to
peer_failed_connection_lost() to fit in.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-02-19 11:36:15 +10:30
parent 65ff5f8bb1
commit f76ff90485
17 changed files with 156 additions and 145 deletions

View File

@@ -15,16 +15,4 @@ status_fail,,desc,wirestring
status_peer_connection_lost,0xFFF3
# They sent us this error.
status_received_errmsg,0xFFF4
status_received_errmsg,,channel,struct channel_id
status_received_errmsg,,desc,wirestring
# We sent them this error.
status_sent_errmsg,0xFFF5
status_sent_errmsg,,channel,struct channel_id
status_sent_errmsg,,desc,wirestring
status_sent_errmsg,,len,u16
status_sent_errmsg,,errmsg,len*u8
# Note: 0xFFFF is reserved for MSG_PASS_FD!
1 #include <common/status_wire.h>
15
16
17
status_sent_errmsg,0xFFF5
status_sent_errmsg,,channel,struct channel_id
status_sent_errmsg,,desc,wirestring
status_sent_errmsg,,len,u16
status_sent_errmsg,,errmsg,len*u8
# Note: 0xFFFF is reserved for MSG_PASS_FD!
18