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

Function peer_final_msg

connectd/connectd.c:1838–1855  ·  view source on GitHub ↗

lightningd tells us to send a msg and disconnect. */

Source from the content-addressed store, hash-verified

1836
1837/* lightningd tells us to send a msg and disconnect. */
1838static void peer_final_msg(struct io_conn *conn,
1839 struct daemon *daemon, const u8 *msg)
1840{
1841 struct peer *peer;
1842 struct node_id id;
1843 u64 counter;
1844 u8 *finalmsg;
1845
1846 if (!fromwire_connectd_peer_final_msg(tmpctx, msg, &id, &counter,
1847 &finalmsg))
1848 master_badmsg(WIRE_CONNECTD_PEER_FINAL_MSG, msg);
1849
1850 /* This can happen if peer hung up on us (or wrong counter
1851 * if it reconnected). */
1852 peer = peer_htable_get(&daemon->peers, &id);
1853 if (peer && peer->counter == counter)
1854 multiplex_final_msg(peer, take(finalmsg));
1855}
1856
1857#if DEVELOPER
1858static void dev_connect_memleak(struct daemon *daemon, const u8 *msg)

Callers 1

recv_reqFunction · 0.85

Calls 2

multiplex_final_msgFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected