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

Function maybe_delete_peer

lightningd/peer_control.c:126–142  ·  view source on GitHub ↗

Last one out deletes peer. */

Source from the content-addressed store, hash-verified

124
125/* Last one out deletes peer. */
126void maybe_delete_peer(struct peer *peer)
127{
128 if (!list_empty(&peer->channels))
129 return;
130 if (peer->uncommitted_channel) {
131 /* This isn't sufficient to keep it in db! */
132 if (peer->dbid != 0) {
133 wallet_peer_delete(peer->ld->wallet, peer->dbid);
134 peer->dbid = 0;
135 }
136 return;
137 }
138 /* Maybe it's reconnected / reconnecting? */
139 if (peer->connected != PEER_DISCONNECTED)
140 return;
141 delete_peer(peer);
142}
143
144static void peer_channels_cleanup(struct lightningd *ld,
145 const struct node_id *id)

Callers 3

delete_channelFunction · 0.85
peer_disconnect_doneFunction · 0.85

Calls 2

delete_peerFunction · 0.85
wallet_peer_deleteFunction · 0.50

Tested by

no test coverage detected