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

Function dual_opend_msg

lightningd/dual_open_control.c:4029–4119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4027}
4028
4029static unsigned int dual_opend_msg(struct subd *dualopend,
4030 const u8 *msg, const int *fds)
4031{
4032 enum dualopend_wire t = fromwire_peektype(msg);
4033 struct channel *channel = dualopend->channel;
4034
4035 switch (t) {
4036 case WIRE_DUALOPEND_GOT_OFFER:
4037 accepter_got_offer(dualopend, dualopend->channel, msg);
4038 return 0;
4039 case WIRE_DUALOPEND_GOT_RBF_OFFER:
4040 rbf_got_offer(dualopend, msg);
4041 return 0;
4042 case WIRE_DUALOPEND_PSBT_CHANGED:
4043 handle_psbt_changed(dualopend, channel, msg);
4044 return 0;
4045 case WIRE_DUALOPEND_COMMIT_READY:
4046 handle_commit_ready(dualopend, channel, msg);
4047 return 0;
4048 case WIRE_DUALOPEND_COMMIT_RCVD:
4049 handle_commit_received(dualopend, channel, msg);
4050 return 0;
4051 case WIRE_DUALOPEND_RBF_VALIDATE:
4052 handle_validate_rbf(dualopend, msg);
4053 return 0;
4054 case WIRE_DUALOPEND_VALIDATE_LEASE:
4055 handle_validate_lease(dualopend, msg);
4056 return 0;
4057 case WIRE_DUALOPEND_FUNDING_SIGS:
4058 handle_peer_tx_sigs_msg(dualopend, msg);
4059 return 0;
4060 case WIRE_DUALOPEND_TX_SIGS_SENT:
4061 handle_peer_tx_sigs_sent(dualopend, fds, msg);
4062 return 0;
4063 case WIRE_DUALOPEND_PEER_LOCKED:
4064 handle_peer_locked(dualopend, msg);
4065 return 0;
4066 case WIRE_DUALOPEND_DRY_RUN:
4067 handle_dry_run_finished(dualopend, msg);
4068 return 0;
4069 case WIRE_DUALOPEND_CHANNEL_LOCKED:
4070 if (tal_count(fds) != 1)
4071 return 1;
4072 handle_channel_locked(dualopend, fds, msg);
4073 return 0;
4074 case WIRE_DUALOPEND_GOT_SHUTDOWN:
4075 handle_peer_wants_to_close(dualopend, msg);
4076 return 0;
4077 case WIRE_DUALOPEND_SHUTDOWN_COMPLETE:
4078 if (tal_count(fds) != 1)
4079 return 1;
4080 handle_channel_closed(dualopend, fds, msg);
4081 return 0;
4082 case WIRE_DUALOPEND_FAIL_FALLEN_BEHIND:
4083 channel_fail_fallen_behind(dualopend, msg);
4084 return 0;
4085 case WIRE_DUALOPEND_VALIDATE_INPUTS:
4086 handle_validate_inputs(dualopend, msg);

Callers

nothing calls this directly

Calls 15

fromwire_peektypeFunction · 0.85
accepter_got_offerFunction · 0.85
rbf_got_offerFunction · 0.85
handle_psbt_changedFunction · 0.85
handle_commit_readyFunction · 0.85
handle_commit_receivedFunction · 0.85
handle_validate_rbfFunction · 0.85
handle_validate_leaseFunction · 0.85
handle_peer_tx_sigs_msgFunction · 0.85
handle_peer_tx_sigs_sentFunction · 0.85
handle_peer_lockedFunction · 0.85
handle_dry_run_finishedFunction · 0.85

Tested by

no test coverage detected