MCPcopy Create free account
hub / github.com/ElementsProject/lightning / dev_disconnect_out

Function dev_disconnect_out

common/dev_disconnect.c:50–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50enum dev_disconnect_out dev_disconnect_out(const struct node_id *id, int pkt_type)
51{
52 if (dev_disconnect_fd == -1)
53 return DEV_DISCONNECT_OUT_NORMAL;
54
55 if (!dev_disconnect_count)
56 next_dev_disconnect();
57
58 if (!dev_disconnect_line[0]
59 || dev_disconnect_line[0] == DEV_DISCONNECT_IN_AFTER_RECV
60 || !streq(peer_wire_name(pkt_type), dev_disconnect_line+1))
61 return DEV_DISCONNECT_OUT_NORMAL;
62
63 if (--dev_disconnect_count != 0) {
64 return DEV_DISCONNECT_OUT_NORMAL;
65 }
66
67 if (lseek(dev_disconnect_fd, dev_disconnect_len+1, SEEK_CUR) < 0) {
68 err(1, "lseek failure");
69 }
70
71 status_peer_debug(id, "dev_disconnect: %s (%s)",
72 dev_disconnect_line,
73 peer_wire_name(pkt_type));
74 return dev_disconnect_line[0];
75}
76
77enum dev_disconnect_in dev_disconnect_in(const struct node_id *id, int pkt_type)
78{

Callers 2

msg_out_dev_disconnectFunction · 0.50
peer_exchange_initmsgFunction · 0.50

Calls 2

next_dev_disconnectFunction · 0.85
errFunction · 0.85

Tested by

no test coverage detected