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

Function dev_disconnect

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

Source from the content-addressed store, hash-verified

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

Callers 2

encrypt_and_sendFunction · 0.50
peer_exchange_initmsgFunction · 0.50

Calls 3

next_dev_disconnectFunction · 0.85
errFunction · 0.85
peer_wire_nameFunction · 0.50

Tested by

no test coverage detected