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

Function dev_disconnect_in

common/dev_disconnect.c:77–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77enum dev_disconnect_in dev_disconnect_in(const struct node_id *id, int pkt_type)
78{
79 if (dev_disconnect_fd == -1)
80 return DEV_DISCONNECT_IN_NORMAL;
81
82 if (!dev_disconnect_count)
83 next_dev_disconnect();
84
85 if (dev_disconnect_line[0] != DEV_DISCONNECT_IN_AFTER_RECV
86 || !streq(peer_wire_name(pkt_type), dev_disconnect_line+1))
87 return DEV_DISCONNECT_IN_NORMAL;
88
89 if (--dev_disconnect_count != 0) {
90 return DEV_DISCONNECT_IN_NORMAL;
91 }
92
93 if (lseek(dev_disconnect_fd, dev_disconnect_len+1, SEEK_CUR) < 0) {
94 err(1, "lseek failure");
95 }
96
97 status_peer_debug(id, "dev_disconnect: %s (%s)",
98 dev_disconnect_line,
99 peer_wire_name(pkt_type));
100 return dev_disconnect_line[0];
101}
102
103void dev_sabotage_fd(int fd, bool close_fd)
104{

Callers 2

read_body_from_peer_doneFunction · 0.50
peer_init_receivedFunction · 0.50

Calls 2

next_dev_disconnectFunction · 0.85
errFunction · 0.85

Tested by

no test coverage detected