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

Function connectd_msg

lightningd/connect_control.c:484–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482}
483
484static unsigned connectd_msg(struct subd *connectd, const u8 *msg, const int *fds)
485{
486 enum connectd_wire t = fromwire_peektype(msg);
487
488 switch (t) {
489 /* These are messages we send, not them. */
490 case WIRE_CONNECTD_INIT:
491 case WIRE_CONNECTD_ACTIVATE:
492 case WIRE_CONNECTD_CONNECT_TO_PEER:
493 case WIRE_CONNECTD_DISCARD_PEER:
494 case WIRE_CONNECTD_DEV_MEMLEAK:
495 case WIRE_CONNECTD_DEV_SUPPRESS_GOSSIP:
496 case WIRE_CONNECTD_PEER_FINAL_MSG:
497 case WIRE_CONNECTD_PEER_CONNECT_SUBD:
498 case WIRE_CONNECTD_PING:
499 case WIRE_CONNECTD_SEND_ONIONMSG:
500 case WIRE_CONNECTD_CUSTOMMSG_OUT:
501 /* This is a reply, so never gets through to here. */
502 case WIRE_CONNECTD_INIT_REPLY:
503 case WIRE_CONNECTD_ACTIVATE_REPLY:
504 case WIRE_CONNECTD_DEV_MEMLEAK_REPLY:
505 case WIRE_CONNECTD_PING_REPLY:
506 break;
507
508 case WIRE_CONNECTD_PEER_CONNECTED:
509 peer_connected(connectd->ld, msg);
510 break;
511
512 case WIRE_CONNECTD_PEER_SPOKE:
513 peer_spoke(connectd->ld, msg);
514 break;
515
516 case WIRE_CONNECTD_PEER_DISCONNECT_DONE:
517 peer_disconnect_done(connectd->ld, msg);
518 break;
519
520 case WIRE_CONNECTD_CONNECT_FAILED:
521 handle_connect_failed(connectd->ld, msg);
522 break;
523
524 case WIRE_CONNECTD_GOT_ONIONMSG_TO_US:
525 handle_onionmsg_to_us(connectd->ld, msg);
526 break;
527
528 case WIRE_CONNECTD_CUSTOMMSG_IN:
529 handle_custommsg_in(connectd->ld, msg);
530 break;
531 }
532 return 0;
533}
534
535static void connect_init_done(struct subd *connectd,
536 const u8 *reply,

Callers

nothing calls this directly

Calls 7

peer_spokeFunction · 0.85
peer_disconnect_doneFunction · 0.85
handle_connect_failedFunction · 0.85
handle_onionmsg_to_usFunction · 0.85
handle_custommsg_inFunction · 0.85
peer_connectedFunction · 0.70
fromwire_peektypeFunction · 0.50

Tested by

no test coverage detected