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

Function handle_master_in

openingd/dualopend.c:4106–4171  ·  view source on GitHub ↗

Standard lightningd-fd-is-ready-to-read demux code. Again, we could hang * here, but if we can't trust our parent, who can we trust? */

Source from the content-addressed store, hash-verified

4104/* Standard lightningd-fd-is-ready-to-read demux code. Again, we could hang
4105 * here, but if we can't trust our parent, who can we trust? */
4106static u8 *handle_master_in(struct state *state)
4107{
4108 u8 *msg = wire_sync_read(tmpctx, REQ_FD);
4109 enum dualopend_wire t = fromwire_peektype(msg);
4110
4111 switch (t) {
4112 case WIRE_DUALOPEND_DEV_MEMLEAK:
4113 if (state->developer) {
4114 handle_dev_memleak(state, msg);
4115 return NULL;
4116 }
4117 break;
4118 case WIRE_DUALOPEND_OPENER_INIT:
4119 opener_start(state, msg);
4120 return NULL;
4121 case WIRE_DUALOPEND_RBF_INIT:
4122 rbf_local_start(state, msg);
4123 return NULL;
4124 case WIRE_DUALOPEND_SEND_TX_SIGS:
4125 handle_send_tx_sigs(state, msg);
4126 return NULL;
4127 case WIRE_DUALOPEND_DEPTH_REACHED:
4128 return handle_funding_depth(state, msg);
4129 case WIRE_DUALOPEND_SEND_SHUTDOWN:
4130 handle_our_shutdown(state, msg);
4131 return NULL;
4132 case WIRE_DUALOPEND_FAIL:
4133 handle_failure_fatal(state, msg);
4134 return NULL;
4135
4136 /* Handled inline */
4137 case WIRE_DUALOPEND_INIT:
4138 case WIRE_DUALOPEND_REINIT:
4139 case WIRE_DUALOPEND_COMMIT_SEND_ACK:
4140 case WIRE_DUALOPEND_PSBT_UPDATED:
4141 case WIRE_DUALOPEND_GOT_OFFER_REPLY:
4142 case WIRE_DUALOPEND_GOT_RBF_OFFER_REPLY:
4143 case WIRE_DUALOPEND_RBF_VALID:
4144 case WIRE_DUALOPEND_VALIDATE_LEASE_REPLY:
4145 case WIRE_DUALOPEND_DEV_MEMLEAK_REPLY:
4146 case WIRE_DUALOPEND_VALIDATE_INPUTS_REPLY:
4147
4148 /* Messages we send */
4149 case WIRE_DUALOPEND_COMMIT_READY:
4150 case WIRE_DUALOPEND_GOT_OFFER:
4151 case WIRE_DUALOPEND_GOT_RBF_OFFER:
4152 case WIRE_DUALOPEND_RBF_VALIDATE:
4153 case WIRE_DUALOPEND_PSBT_CHANGED:
4154 case WIRE_DUALOPEND_COMMIT_RCVD:
4155 case WIRE_DUALOPEND_FUNDING_SIGS:
4156 case WIRE_DUALOPEND_TX_SIGS_SENT:
4157 case WIRE_DUALOPEND_PEER_LOCKED:
4158 case WIRE_DUALOPEND_CHANNEL_LOCKED:
4159 case WIRE_DUALOPEND_GOT_SHUTDOWN:
4160 case WIRE_DUALOPEND_SHUTDOWN_COMPLETE:
4161 case WIRE_DUALOPEND_FAIL_FALLEN_BEHIND:
4162 case WIRE_DUALOPEND_DRY_RUN:
4163 case WIRE_DUALOPEND_VALIDATE_LEASE:

Callers 1

mainFunction · 0.70

Calls 11

fromwire_peektypeFunction · 0.85
opener_startFunction · 0.85
rbf_local_startFunction · 0.85
handle_send_tx_sigsFunction · 0.85
handle_our_shutdownFunction · 0.85
handle_failure_fatalFunction · 0.85
tal_hexFunction · 0.85
handle_dev_memleakFunction · 0.70
handle_funding_depthFunction · 0.70
wire_sync_readFunction · 0.50
status_failedFunction · 0.50

Tested by

no test coverage detected