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? */
| 3635 | /* Standard lightningd-fd-is-ready-to-read demux code. Again, we could hang |
| 3636 | * here, but if we can't trust our parent, who can we trust? */ |
| 3637 | static u8 *handle_master_in(struct state *state) |
| 3638 | { |
| 3639 | u8 *msg = wire_sync_read(tmpctx, REQ_FD); |
| 3640 | enum dualopend_wire t = fromwire_peektype(msg); |
| 3641 | |
| 3642 | switch (t) { |
| 3643 | case WIRE_DUALOPEND_DEV_MEMLEAK: |
| 3644 | #if DEVELOPER |
| 3645 | handle_dev_memleak(state, msg); |
| 3646 | #endif |
| 3647 | return NULL; |
| 3648 | case WIRE_DUALOPEND_OPENER_INIT: |
| 3649 | opener_start(state, msg); |
| 3650 | return NULL; |
| 3651 | case WIRE_DUALOPEND_RBF_INIT: |
| 3652 | rbf_local_start(state, msg); |
| 3653 | return NULL; |
| 3654 | case WIRE_DUALOPEND_SEND_TX_SIGS: |
| 3655 | handle_send_tx_sigs(state, msg); |
| 3656 | return NULL; |
| 3657 | case WIRE_DUALOPEND_DEPTH_REACHED: |
| 3658 | return handle_funding_depth(state, msg); |
| 3659 | case WIRE_DUALOPEND_SEND_SHUTDOWN: |
| 3660 | handle_our_shutdown(state, msg); |
| 3661 | return NULL; |
| 3662 | case WIRE_DUALOPEND_FAIL: |
| 3663 | handle_failure_fatal(state, msg); |
| 3664 | return NULL; |
| 3665 | |
| 3666 | /* Handled inline */ |
| 3667 | case WIRE_DUALOPEND_INIT: |
| 3668 | case WIRE_DUALOPEND_REINIT: |
| 3669 | case WIRE_DUALOPEND_PSBT_UPDATED: |
| 3670 | case WIRE_DUALOPEND_GOT_OFFER_REPLY: |
| 3671 | case WIRE_DUALOPEND_GOT_RBF_OFFER_REPLY: |
| 3672 | case WIRE_DUALOPEND_RBF_VALID: |
| 3673 | case WIRE_DUALOPEND_VALIDATE_LEASE_REPLY: |
| 3674 | case WIRE_DUALOPEND_DEV_MEMLEAK_REPLY: |
| 3675 | |
| 3676 | /* Messages we send */ |
| 3677 | case WIRE_DUALOPEND_GOT_OFFER: |
| 3678 | case WIRE_DUALOPEND_GOT_RBF_OFFER: |
| 3679 | case WIRE_DUALOPEND_RBF_VALIDATE: |
| 3680 | case WIRE_DUALOPEND_PSBT_CHANGED: |
| 3681 | case WIRE_DUALOPEND_COMMIT_RCVD: |
| 3682 | case WIRE_DUALOPEND_FUNDING_SIGS: |
| 3683 | case WIRE_DUALOPEND_TX_SIGS_SENT: |
| 3684 | case WIRE_DUALOPEND_PEER_LOCKED: |
| 3685 | case WIRE_DUALOPEND_CHANNEL_LOCKED: |
| 3686 | case WIRE_DUALOPEND_GOT_SHUTDOWN: |
| 3687 | case WIRE_DUALOPEND_SHUTDOWN_COMPLETE: |
| 3688 | case WIRE_DUALOPEND_FAIL_FALLEN_BEHIND: |
| 3689 | case WIRE_DUALOPEND_DRY_RUN: |
| 3690 | case WIRE_DUALOPEND_VALIDATE_LEASE: |
| 3691 | case WIRE_DUALOPEND_LOCAL_PRIVATE_CHANNEL: |
| 3692 | break; |
| 3693 | } |
| 3694 | status_failed(STATUS_FAIL_MASTER_IO, |
no test coverage detected