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

Function onchain_msg

lightningd/onchain_control.c:524–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524static unsigned int onchain_msg(struct subd *sd, const u8 *msg, const int *fds UNUSED)
525{
526 enum onchaind_wire t = fromwire_peektype(msg);
527
528 switch (t) {
529 case WIRE_ONCHAIND_INIT_REPLY:
530 handle_onchain_init_reply(sd->channel, msg);
531 break;
532
533 case WIRE_ONCHAIND_BROADCAST_TX:
534 handle_onchain_broadcast_tx(sd->channel, msg);
535 break;
536
537 case WIRE_ONCHAIND_UNWATCH_TX:
538 handle_onchain_unwatch_tx(sd->channel, msg);
539 break;
540
541 case WIRE_ONCHAIND_EXTRACTED_PREIMAGE:
542 handle_extracted_preimage(sd->channel, msg);
543 break;
544
545 case WIRE_ONCHAIND_MISSING_HTLC_OUTPUT:
546 handle_missing_htlc_output(sd->channel, msg);
547 break;
548
549 case WIRE_ONCHAIND_HTLC_TIMEOUT:
550 handle_onchain_htlc_timeout(sd->channel, msg);
551 break;
552
553 case WIRE_ONCHAIND_ALL_IRREVOCABLY_RESOLVED:
554 handle_irrevocably_resolved(sd->channel, msg);
555 break;
556
557 case WIRE_ONCHAIND_ADD_UTXO:
558 onchain_add_utxo(sd->channel, msg);
559 break;
560
561 case WIRE_ONCHAIND_ANNOTATE_TXIN:
562 onchain_annotate_txin(sd->channel, msg);
563 break;
564
565 case WIRE_ONCHAIND_ANNOTATE_TXOUT:
566 onchain_annotate_txout(sd->channel, msg);
567 break;
568
569 case WIRE_ONCHAIND_NOTIFY_COIN_MVT:
570 handle_onchain_log_coin_move(sd->channel, msg);
571 break;
572
573 /* We send these, not receive them */
574 case WIRE_ONCHAIND_INIT:
575 case WIRE_ONCHAIND_SPENT:
576 case WIRE_ONCHAIND_DEPTH:
577 case WIRE_ONCHAIND_HTLCS:
578 case WIRE_ONCHAIND_KNOWN_PREIMAGE:
579 case WIRE_ONCHAIND_DEV_MEMLEAK:
580 case WIRE_ONCHAIND_DEV_MEMLEAK_REPLY:
581 break;

Callers

nothing calls this directly

Calls 12

onchain_add_utxoFunction · 0.85
onchain_annotate_txinFunction · 0.70
onchain_annotate_txoutFunction · 0.70
fromwire_peektypeFunction · 0.50

Tested by

no test coverage detected